⏳ This skill is pending AI review.

Scores will appear once the review pipeline completes.

v0.17.0

genui

omdsh-dev@omdsh-dev⭐ 1.0k stars· last commit 2d ago· 6 open issues

Render structured interactive UI inline through the dsh-ui fence. Use for key points, emphasis, comparisons, flows, steps, status, data, demos, and interactions whenever structured presentation would be clearer than prose. Preserve conversation language for all user-visible text.

Choose how to use this skill

You do not need every option. Choose the path your AI client supports. The stable page stays the same; versioned files are immutable.

1. Native installer

This listing has no registered native installer command. Use the complete package or source fallback below, depending on what your client supports.

Do not guess an installer command or replace an existing version without reviewing the diff.

2. Complete package recommended

Download the ZIP when available. It includes SKILL.md plus the references, security notes and version metadata.

No complete ProSkills package is published for this listing yet.

3. Prompt-only

Copy the prompt above when the agent can read the stable page or when you want to adopt the workflow without installing a skill.

Need only the instruction file?

Download SKILL.md only if your client requires a single file. The complete ZIP is safer for a full installation because it preserves the references and release context.

No path installs or executes anything by itself. Your agent still needs access to the project files. Before updating, compare the installed version and review the diff.

—/10

// RATINGS

⭐GitHub Stars
⭐⭐⭐⭐⭐ 1.0k on GitHubGitHub ↗

Very popular

🟢ProSkills Score
—
📍

Not yet listed on ClawHub or SkillsMP

// README

npm version DSH Compatibility License: MIT TypeScript Topic: dsh-plugin


GenUI turns DeepSeek Harness (DSH) assistant replies into safe, fully interactive UI surfaces.

[!IMPORTANT] Install GenUI using the full npm package name @changfenhuang/dsh-genui. See Quick Start for setup.

Ask “How are this month’s orders doing?”, and instead of plain text or raw code blocks, the response streams out an interactive sortable data table, audio/video players, draggable function plots, self-grading quizzes, or a persistent workspace dock — all embedded seamlessly within the conversation.


🎬 Real Interface Showcase

[!NOTE] Real Interface Captures: All recordings and screenshots below are captured directly from real DSH interface rendering — no conceptual mockups or faked pre-renders.

40-Second Walkthrough

https://github.com/user-attachments/assets/f5db33ec-7471-4d4a-a85b-79c9962ab4ef

Three Concrete Real Outputs

1. Monitoring Panel: Answer is the Dashboard2. Function Plot: Drag to Redraw Instantly3. Composable Hierarchy: Work Surface
Monitoring PanelFunction PlotComposable Hierarchy
Data Insights: Eyebrow stats, filterable/drill-down service table, grouped totals, and spark/ring cells directly live in the assistant reply.Zero-Latency Exploration: plot draws mathematical curves; drag parameter sliders to re-calculate and redraw locally in real time.Structured Hierarchy: Display quotes, stat cards, ring progress, and labeled chapter dividers composed declaratively by the model.

✨ Before vs. After

ScenarioPlain Text ResponseWith dsh-genui
Business Overview“Revenue this month is ¥128,430 (+12.4% MoM); conversion rate is slightly dipping…”One line of concise prose + 3 stat cards (revenue/orders/conversion), a trend chart, and a progress bar rendered right beside it.
Data ExplorationType another prompt to ask the model to re-sort or filter.Click table headers to sort numbers locally, or use the search box to filter rows in real time.
Parameter TuningRe-prompt the model and wait for another full generation.Drag sliders to see curves update in sub-millisecond speed with animation preview.
Next ActionsCopy text and manually perform follow-up tasks elsewhere.Click interactive action buttons (e.g. “Refresh”, “Switch View”) to trigger bidirectional model event loops.

🚀 Quick Start

1. Prerequisites

Ensure your environment meets the following requirements:

  • DSH Version: ^0.2.0-rc.1 || ^0.2.1-rc.1 || ^0.2.2-alpha.2. Packed browser acceptance covers 0.2.0-rc.1, 0.2.1-rc.3 and the exact npm hosts 0.2.2-rc.1 (current latest / next) and 0.2.2-alpha.2; 0.2.1-rc.4 and 0.2.1-rc.5 retain separate public-API, full-unit-suite and build checks. The current RC and alpha hosts require Node.js >=24.9.0. Its gallery, computed-field and Map acceptance uses official local replay; third-party sidebar integration is checked on rc.3.
  • pnpm on PATH: The dsh plugin CLI requires pnpm. If missing: run corepack enable or npm i -g pnpm, then open a new terminal and confirm pnpm -v prints a version number.

2. Install & Activate

Run a single command in your terminal (all dependencies are fetched automatically):

# Public npm package (works without an npm account)
dsh plugin --profile web add @changfenhuang/dsh-genui

[!TIP] Adding only as a Node package? Run npm install @changfenhuang/dsh-genui. Note that npm install only adds the dependency and does not register the plugin with DSH; use the dsh plugin add command above for DSH integration.

3. Verify in 60 Seconds

  1. Restart the DSH web service and hard refresh your browser (Cmd + Shift + R or Ctrl + F5).
  2. In a new conversation session, send:
    Use dsh-ui to draw a stats dashboard with a sortable service table.
    
  3. Expected result: The reply renders an in-place interactive dashboard rather than a plain code block.
  4. Console activation check: Open your browser Developer Tools Console and look for [genui] client active; fence-channel=dom.

[!WARNING]

⚠️ Installation Pitfalls to Avoid

  1. Do Not Use link: on a Freshly Cloned Directory: link: alone does not bundle or resolve peer assets (mermaid, three.js, React). Use npm for standard usage; reserve link: strictly for local development (see Developer Guide).
  2. Migrating from Legacy @omdsh-dev: If you installed from GitHub or the old org name before v0.9.2, clean up the stale key:
    dsh plugin --profile web remove @omdsh-dev/dsh-genui
    dsh plugin --profile web add @changfenhuang/dsh-genui
    

🧩 Capability Matrix

Every component and behavior is guarded by the strict dsh-ui specification. See SKILL.md for full JSON schema details.

dsh-genui Capabilities
├── 🌊 1. Streaming & Realtime Mounting
├── 🎨 2. 30+ Component Ecosystem
├── ⚡ 3. Local-First Responsiveness
├── 🔄 4. Bidirectional Action Event Loop
├── 📌 5. Persistent Session Workspace & Templates
└── 🛡️ 6. Sandboxing, Guards & Self-Healing

1. 🌊 Streaming & Realtime Mounting

  • Answer-as-UI: Components stream into the conversation as tokens arrive, mounting incrementally without waiting for the full reply to finish.
  • Graceful Fallback: If the plugin is absent or disabled, fences degrade cleanly to standard Markdown code blocks without breaking the chat history.

2. 🎨 30+ Component Ecosystem

  • Display & Typography: Hero banner, Stat cards (stat with eyebrow labels, deltas, and sparklines), Tables, Timelines, Code Diffs, Step progress, File trees (interactive expand/collapse), Callouts, and Badges.
  • Content Font Size: Card typography grows with the host's Appearance → Content Font Size setting above 17px. At 17px or below, e

// HOW IT'S BUILT

// FILES

440 files shipped with this skill. Inline text is the catalog copy. The upstream link is the source repository.

  • SKILL.md61 KB79cc94ff7241truncatedupstream ↗

    Showing the inlined prefix. The rest is in the upstream file.

    ---
    name: genui
    description: "Render structured interactive UI inline through the dsh-ui fence. Use for key points, emphasis, comparisons, flows, steps, status, data, demos, and interactions whenever structured presentation would be clearer than prose. Preserve conversation language for all user-visible text."
    ---
    
    # GenUI — 生成式 UI 输出规范
    
    **Language:** Match the user's requested language (otherwise the language of their message) in both surrounding prose and all user-visible UI text: titles, labels, content, options, and explanations. Chinese examples below illustrate the schema only; do not switch the conversation to Chinese after loading this skill. Keep JSON keys, component types, IDs, and actions unchanged. An English request gets English prose and UI text; a Chinese request gets Chinese prose and UI text. `<user-language ...>` tokens are meta-placeholders only. Replace every one with actual content in the conversation language; never emit these placeholders literally.
    
    你可以**在回答正文中间**输出可交互 UI 组件:写一个 `dsh-ui` 围栏(fenced block with language tag `dsh-ui`),内含 JSON 规格,渲染器会把这一整块画成真实组件,文字照常穿插在前后。组件**就是回答的一部分**,不是工具调用。
    
    ```dsh-ui
    {"title":"<user-language text>","gap":14,"items":[...]}
    ```
    
    ## 围栏书写铁律(先读这一节)
    
    围栏开头那一行的语言标记**统一写 `dsh-ui`**,不要添加标点、引号或注释。渲染器会容错大小写、首尾空格和部分尾部标点;其他语言标记不会作为 GenUI 接管,用户会看到普通代码块。
    
    | 写法 | 结果 |
    | --- | --- |
    | ` ```dsh-ui ` | ✅ 渲染 |
    | ` ```dsh-ui> ` | ✅ 容错渲染;生成时仍应去掉 `>` |
    | ` ```dsh-ui ` 带行尾空格 | ✅ 渲染(自动 trim) |
    | ` ``` DSH-UI ` | ✅ 渲染(忽略大小写) |
    | ` ```dshui ` / ` ```ds-ui ` | ❌ 不是合法标记 |
    
    此前同一模型曾在同一会话里写出 **182** 个 ` ```dsh-ui> ` 围栏并导致静默失效;现在已对这类尾部标点统一容错。写围栏时**只写 `dsh-ui` 这六个字符**,不要加任何标点、引号、注释;收尾必须是单独一行的 ` ``` `。
    
    围栏位置:只写在**回答正文**里。写进 reasoning / 思考块不会渲染,用户看不到。
    
    公式:`$...$` / `\(...\)` 为行内公式,`$$...$$` / `\[...\]` 为独立公式;支持矩阵、分段函数、多行对齐推导,以及加粗/高亮内的公式。正文、列表、键值、表头/单元格、卡片/步骤/时间线/标签页标题、题目与说明、按钮与表单标签、指标、媒体说明和图表外层标题共用此能力。JSON 字符串中的反斜杠必须双写,如 `"content": "\\(\\frac{a}{b}\\)"`。代码源码、输入值/占位符、原生下拉选项和图表引擎内部绘图文本仍遵循各自的原生格式,不解析富文本。数学语法以 KaTeX 为准,不执行 HTML、外部资源或脚本;不支持 LaTeX 文档编译、加载任意宏包。
    
    ## 组件词汇(只允许这些 type)
    
    布局:`text` `row` `col` `grid` `card` `carousel` `divider` `spacer` `arrow` `hero`
    展示:`stat` `badge` `progress` `list` `table` `keyvalue` `avatar` `image` `image-group` `compare` `audio` `video` `timeline` `file-tree` `breadcrumb` `diff` `json` `code` `callout` `steps` `icon` `blocks`
    图表:`chart`(bars/line/donut,可多序列)`plot`(数学函数图)`echart`(ECharts 全功能图表)
    交互:`button` `input` `select` `checkbox` `radio` `switch` `slider` `textarea` `editor` `date-picker` `segmented-control` `tabs` `accordion` `copy` `link` `submit` `popover`
    高级:`svg` `mermaid` `diagram` `scene3d` `quiz` `entity-card`
    
    ### 布局
    - text: `{"type":"text","size":"display|h1|h2|h3|body|muted|caption","content":"...","align":"left|center|right"?}`(`tone:"danger|success|warning|info|muted"` 给整行文字上语义色,不用套 badge;`mono:true` 走等宽字体,用于十六进制/二进制/标识符,不带行内代码底色)(`size:"display"` 比标题大一档,作引言/开篇点题句,**一条回答 ≤1**;`center:true` 是旧写法,等价 `align:"center"`,新写一律用 `align`)
    - row / col: `{"type":"row"|"col","items":[...],"wrap":true?,"spacer":true?,"gap":n?}`;`row.justify:"center"` 主轴居中(图标+标题那种图头);`col.width:n`(1-100)给这一列占行宽的百分比,不写就按内容宽
    - grid: `{"type":"grid","cols":n,"items":[...]}`;`columns` 可作为 `cols` 的别名,校验会提示使用规范字段。
    - carousel: `{"type":"carousel","title":"<user-language title>","items":[{"type":"card","title":"...","items":[...]}],"itemWidth":240?,"gap":3?}` — 原生节点横向滚动;最多 24 项,宽度 80–640px 且不超过轨道宽度的 85%;默认宽度 240px。`gap` 数值乘以 4px,省略时为 12px,负数按 0 处理。导航按钮每次滚动轨道宽度的 85%,仅在内容溢出时显示,触摸设备直接滑动轨道。不自动播放。轨道聚焦时支持左右键 / Home / End,卡片内表单按原提交规则工作。浏览与滑动不发 action;子组件自身声明的 action 按既有交互规则触发。流式输出只在尾部追加卡片以保留已有输入路径。
    - hero: `{"type":"hero","title":"<user-language title>","subtitle":"<user-language text>","value":"99.96%","label":"<user-language metric>","delta":"+0.02%","spark":[...],"tone":"accent|success|warning|danger"}` — **封面块**:eyebrow + 超大数字(52px,带入场计数)+ 标题 + 副标题 + tone 渐变底色。**一条回答最多用一个**,放在最前面当视觉锚点
    - span: 任意节点都可加 `"span":2`(grid 子节点占几列)——bento 排版的唯一原语:一张 `span:2` 宽卡配一张窄卡,比一列方块堆下去好看得多
    - card: `{"type":"card","title":"...","items":[...]}`;`"tone":"info|success|warning|danger"` 给卡片语义底色(用于结论卡/风险卡);`"accent":"#f59e0b"` 指定强调色(边框 + 标题 + 极淡底色);`"flat":true` 去掉阴影、换成极淡中性底——**图里的面板必须用 flat**,否则每层都像浮起的卡片,叠两层就脏了;`"eyebrow":"<user-language 小引题>"` 在标题上方加一行 meta 小字(把多张卡分章时用——**连续同章的卡片不要每张都加**,一段回答 ≤3 个)
    - palette: `chart` / `echart` 都支持 `"palette":["#ff8800","#3ecf8e"]` 覆盖分类色板(默认跟随宿主主题)。**只有语义上需要指定颜色时才写**(成本=红、收益=绿),否则跟随主题更稳
    - divider: `{"type":"divider"}`;**带章节名** `{"type":"divider","label":"<user-language 章节名>"}`(线 + 小标签居中,作章节切换:报告从摘要切入数据、图表册开新章时用一段;卡片/列表内部、连续同主题内容之间**不要用**,一条回答 ≤3 个); spacer: `{"type":"spacer"}`
    
    ### 展示
    - stat: `{"type":"stat","label":"...","value":"...","delta":"+12.4%|-3%"}`(`-` 开头自动红、`+` 绿);可选 `"spark":[3,5,4,8,6]` 画一条微趋势线(2–60 个有限数值);`"size":"hero"` 渲染超大数字(一条回答最多用一次,作为视觉锚点)
    - badge: `{"type":"badge","label":"...","tone":"success|warn|danger|accent","icon":"emoji?"}`
    - progress: `{"type":"progress","label":"...","value":0-100,"valueLabel":"70%"}`;`"variant":"ring"` 画环形进度,`"target":70` 在轨道上标出目标刻度
    - avatar: `{"type":"avatar","name":"...","color":"#hex?"}`
    - image: `{"type":"image","src":"/mmx-files/result.png","alt":"<user-language description>"}` — 展示浏览器可访问的 http(s) 或同源相对图片地址;懒加载;不支持 `file:`/`data:` 等本地或主动协议;`"caption":"<user-language 图注>"` 在图**下方**加说明行(来源/解读/署名;`alt` 是图**上方**的标签行,两者分工不同)
    - image-group: `{"type":"image-group","title":"<user-language title>","items":[{"src":"/mmx-files/a.png","alt":"<description>","caption":"<caption>"},{"src":"/mmx-files/b.png","alt":"<description>"}]}` — 最多 24 张图片按长宽比自适应换行;点击原生 lightbox 放大,左右键 / Home / End 切图,Esc / 关闭按钮返回并恢复焦点。沿用 image 的 http(s) / 相对地址限制;不接受 file/data/javascript。只做本地浏览,不发 action;需要模型动作请在旁边放独立 button。追加 / 重排保留当前 src;当前图片移除后关闭查看器;相同 src 按出现次序区分。空列表与图片加载失败都有明确状态。导出 HTML 不内嵌图片字节,图片仍依赖原地址。[完整用法与验收](docs/gallery.md)。
    - compare: `{"type":"compare","title":"<user-language title>","before":{"src":"/shot-before.png","label":"<user-language label>","caption":"<caption>"},"after":{"src":"/shot-after.png","label":"<user-language label>"},"mode":"side|stack|slider","height":260}` — **两张图成对呈现**:改动前后、方案 A/B、原图与重绘。`before`/`after` 都必填,缺一侧整节点丢弃(不是降级成单图)。`mode`:`side`(默认,容器够宽时并排,窄于 560px 自动竖排)、`stack`(始终竖排,适合长截图)、`slider`(单框中间一条可拖动分割线,指针拖动 / 触摸 / 方向键 / Home / End 都能用)。`height` 是框高上限 120–640(默认 260),图片按 contain 装进框内、不裁切。标签 `label` 常显,不靠悬停;点击图片原地开原生对话框放大,Esc / 关闭返回并恢复焦点。图片地址沿用 image 的 http(s) / 相对地址限制;只做本地浏览不发 action。**汇报改动(修了什么、前后差异)时默认用它**,而不是表格或纯文字清单——读者要的是「变成什么样了」,不是字段名。只在两张图必须被对照阅读时才用;同一批无关截图用 image-group。
    
    **本机截图怎么进回答**:`image` / `image-group` / `compare` 的 `src` 只接受浏览器能拿到的地址。本机文件走宿主已有的鉴权文件路由,直接写 URL,不用搬文件、不用配目录:
    `/api/file?path=<绝对路径,percent-encoded>`(例:`/api/file?path=%2FUsers%2Fme%2Fproj%2F.a.png`)。宿主用同一个路由渲染 Markdown 里的本地图片,支持 png/jpeg/webp/gif/svg,带大小上限与沙箱策略。典型用法:同一处改动前后各截一张,用 `compare` 摆出来,而不是用文字描述"改了什么"。
    - audio: `{"type":"audio","src":"/mmx-files/result.mp3","alt":"<user-language description>","loop":true?}` — 原生控制条;用户主动播放,不自动播放;仅 http(s) 或同源相对地址
    - video: `{"type":"video","src":"/mmx-files/result.mp4","alt":"<user-language description>","poster":"/mmx-files/poster.jpg"?,"loop":true?,"muted":true?,"aspectRatio":"16:9|4:3|1:1|9:16"?}` — 原生播放/音量/全屏控制;不自动播放
    - list: `{"type":"list","items":["..."] 或 [{"title":"...","desc":"..."}] 或嵌套节点(如 {"type":"badge","label":"TS"})}` — 行内可嵌节点(计入节点预算);记录中的 `label`/`name` 归一化为 `title`,`description`/`content`/`text`/`body`/`detail` 归一化为 `desc`;只有正文时将正文用作标题,未知字段会收到警告
    - table: `{"type":"table","columns":["..."],"rows":[["...","..."]],"types":["text|num|delta|bar|badge"]?,"details":[[...]]?,"total":true?}` — 表头点击本地排序(升/降/还原,零往返);数值感知:千分位(`1,234`)、`k/m/b`、`万/亿`、`%`、货币符号都能按真实数值比较,纯数值列自动右对齐;**带符号单元格自动着色**(`+12.4%` 绿、`-3` 红,无需额外字段);`types` 可按列指定 `bar`(0-100 内联进度条)、`ring`(0-100 小环)、`spark`(单元格写 `"3,5,4,8"` 画微趋势线)、`badge`(胶囊标签)、`delta`(强制涨跌色)、`num`(强制右对齐)、`index`(行号)、`group`(首列当分组标题:该行只有第一格有内容时渲染成跨列小标题);`"total":true` 追加合计行(数值列自动求和);**`"export":true`**:表格上方出现「复制 Markdown / 复制 CSV」两个小按钮(纯本地剪贴板,不发请求);**`"filter":"输入框id"`**:把表格和某个 input/select 绑定,读者输入即时过滤(`filterColumn` 
  • README.md23 KB3b16d7e3db2bupstream ↗
    <div align="center">
    
    <img src="./assets/genui-logo.svg" width="380" alt="GenUI for DeepSeek Harness">
    
    <p align="center">
      <strong>Generative UI for DeepSeek Harness (DSH)</strong><br>
      Interactive, rich components rendered inline alongside the model's textual responses.
    </p>
    
    [![npm version](https://img.shields.io/npm/v/@changfenhuang/dsh-genui.svg?style=flat-square&color=3B82F6)](https://www.npmjs.com/package/@changfenhuang/dsh-genui)
    [![DSH Compatibility](https://img.shields.io/badge/DSH-^0.2.0--rc.1%20||%20^0.2.1--rc.1%20||%20^0.2.2--alpha.2-10B981?style=flat-square)](https://github.com/omdsh-dev/dsh-genui)
    [![License: MIT](https://img.shields.io/badge/License-MIT-amber.svg?style=flat-square)](LICENSE)
    [![TypeScript](https://img.shields.io/badge/TypeScript-Ready-blue?style=flat-square&logo=typescript)](https://www.typescriptlang.org/)
    [![Topic: dsh-plugin](https://img.shields.io/badge/ecosystem-dsh--plugin-purple?style=flat-square)](https://github.com/topics/dsh-plugin)
    
    <p align="center">
      <strong>English</strong> · <a href="./README.zh-CN.md">简体中文</a>
    </p>
    
    <p align="center">
      <a href="https://omdsh-dev.github.io/dsh-genui/"><strong>🌐 Live Product Site</strong></a> · 
      <a href="#-real-interface-showcase"><strong>🎬 Real Demo</strong></a> · 
      <a href="#-quick-start"><strong>🚀 Quick Start</strong></a> · 
      <a href="#-capability-matrix"><strong>🧩 Feature Matrix</strong></a> · 
      <a href="./SKILL.md"><strong>📖 Component Syntax (SKILL.md)</strong></a>
    </p>
    
    </div>
    
    ---
    
    `dsh-genui` turns DeepSeek Harness (DSH) assistant replies into **safe, fully interactive UI surfaces**.
    
    Ask “How are this month’s orders doing?”, and instead of plain text or raw code blocks, the response streams out an **interactive sortable data table**, **audio/video players**, **draggable function plots**, **self-grading quizzes**, or a **persistent workspace dock** — all embedded seamlessly within the conversation.
    
    ---
    
    ## 🎬 Real Interface Showcase
    
    > [!NOTE]
    > **Real Interface Captures:** All recordings and screenshots below are captured directly from real DSH interface rendering — no conceptual mockups or faked pre-renders.
    
    ### 40-Second Walkthrough
    
    <div align="center">
    
    https://github.com/user-attachments/assets/f5db33ec-7471-4d4a-a85b-79c9962ab4ef
    
    <p align="center">
      <a href="./assets/demo.mp4"><img src="./assets/demo-thumb.png" width="88%" alt="Preview of the complete dsh-genui walkthrough video"></a>
      <br><em>(Click the thumbnail to download the <a href="./assets/demo.mp4">original MP4</a> if the GitHub video player fails to load. The prompt sequence is documented in <a href="./demo-prompts.md">demo-prompts.md</a>.)</em>
    </p>
    
    </div>
    
    ### Three Concrete Real Outputs
    
    | 1. Monitoring Panel: Answer is the Dashboard | 2. Function Plot: Drag to Redraw Instantly | 3. Composable Hierarchy: Work Surface |
    | :--- | :--- | :--- |
    | ![Monitoring Panel](./assets/showcase-panel.png) | ![Function Plot](./assets/showcase-plot.png) | ![Composable Hierarchy](./assets/showcase.png) |
    | **Data Insights:** Eyebrow stats, filterable/drill-down service table, grouped totals, and spark/ring cells directly live in the assistant reply. | **Zero-Latency Exploration:** `plot` draws mathematical curves; drag parameter sliders to re-calculate and redraw locally in real time. | **Structured Hierarchy:** Display quotes, stat cards, ring progress, and labeled chapter dividers composed declaratively by the model. |
    
    ---
    
    ## ✨ Before vs. After
    
    | Scenario | Plain Text Response | With dsh-genui |
    | :--- | :--- | :--- |
    | **Business Overview** | “Revenue this month is ¥128,430 (+12.4% MoM); conversion rate is slightly dipping…” | One line of concise prose + 3 stat cards (revenue/orders/conversion), a trend chart, and a progress bar rendered right beside it. |
    | **Data Exploration** | Type another prompt to ask the model to re-sort or filter. | Click table headers to **sort numbers locally**, or use the search box to filter rows in real time. |
    | **Parameter Tuning** | Re-prompt the model and wait for another full generation. | Drag sliders to see curves update in **sub-millisecond speed** with animation preview. |
    | **Next Actions** | Copy text and manually perform follow-up tasks elsewhere. | Click interactive action buttons (e.g. “Refresh”, “Switch View”) to trigger **bidirectional model event loops**. |
    
    ---
    
    ## 🚀 Quick Start
    
    ### 1. Prerequisites
    
    Ensure your environment meets the following requirements:
    - **DSH Version**: `^0.2.0-rc.1 || ^0.2.1-rc.1 || ^0.2.2-alpha.2`. Packed browser acceptance covers `0.2.0-rc.1`, `0.2.1-rc.3` and the exact npm hosts `0.2.1-rc.5` (current `latest` / `next`) and `0.2.2-alpha.2`; the earlier `0.2.1-rc.4` retains separate public-API, full-unit-suite and build checks. The alpha host requires **Node.js >=24.9.0**. Its gallery, computed-field and Map acceptance uses official local replay; third-party sidebar integration is checked on rc.3.
    - **pnpm on PATH**: The `dsh plugin` CLI requires pnpm. If missing: run `corepack enable` or `npm i -g pnpm`, then **open a new terminal** and confirm `pnpm -v` prints a version number.
    
    ### 2. Install & Activate
    
    Run a single command in your terminal (all dependencies are fetched automatically):
    
    ```sh
    # Public npm package (works without an npm account)
    dsh plugin --profile web add @changfenhuang/dsh-genui
    ```
    
    > [!TIP]
    > **Adding only as a Node package?** Run `npm install @changfenhuang/dsh-genui`. Note that `npm install` only adds the dependency and does not register the plugin with DSH; use the `dsh plugin add` command above for DSH integration.
    
    ### 3. Verify in 60 Seconds
    
    1. Restart the DSH web service and **hard refresh** your browser (`Cmd + Shift + R` or `Ctrl + F5`).
    2. In a **new conversation session**, send:
       ```text
       Use dsh-ui to draw a stats dashboard with a sortable service table.
       ```
    3. **Expected result**: The reply renders an in-place interactive dashboard rather than a plain code block.
    4. **Console activation check**: Open your browser Developer Tools Console and look for `[genui] client active; fence-channel=dom`.
    
    ---
    
    > [!WARNING]
    > ### ⚠️ Installation Pitfalls to Avoid
    > 
    > 1. **Watch the Package Scope (Crucial)**:
    >    The package must be **`@changfenhuang/dsh-genui`**. npm hosts an unrelated, unscoped package named `dsh-genui` (a Vue/OpenTiny implementation by another maintainer); installing it will fail due to incompatible host peer dependencies.
    > 2. **Do Not Use `link:` on a Freshly Cloned Directory**:
    >    `link:` alone does not bundle or resolve peer assets (mermaid, three.js, React). Use npm for standard usage; reserve `link:` strictly for local development (see [Developer Guide](#-developer-guide)).
    > 3. **Migrating from Legacy `@omdsh-dev`**:
    >    If you installed from GitHub or the old org name before v0.9.2, clean up the stale key:
    >    ```sh
    >    dsh plugin --profile web remove @omdsh-dev/dsh-genui
    >    dsh plugin --profile web add @changfenhuang/dsh-genui
    >    ```
    
    ---
    
    ## 🧩 Capability Matrix
    
    Every component and behavior is guarded by the strict `dsh-ui` specification. See [SKILL.md](./SKILL.md) for full JSON schema details.
    
    ```
    dsh-genui Capabilities
    ├── 🌊 1. Streaming & Realtime Mounting
    ├── 🎨 2. 30+ Component Ecosystem
    ├── ⚡ 3. Local-First Responsiveness
    ├── 🔄 4. Bidirectional Action Event Loop
    ├── 📌 5. Persistent Session Workspace & Templates
    └── 🛡️ 6. Sandboxing, Guards & Self-Healing
    ```
    
    ### 1. 🌊 Streaming & Realtime Mounting
    - **Answer-as-UI**: Components stream into the conversation as tokens arrive, mounting incrementally without waiting for the full reply to finish.
    - **Graceful Fallback**: If the plugin is absent or disabled, fences degrade cleanly to standard Markdown code blocks without breaking the chat history.
    
    ### 2. 🎨 30+ Component Ecosystem
    - **Display & Typography**: Hero banner, Stat cards (`stat` with eyebrow labels, deltas, and sparklines), Tables, Timelines, Code Diffs, Step progress, File trees (interactive expand/collapse), Callouts, and Badges.
    - **Content Font Size**: Card typography grows with the host's Appearance → Content Font Size setting above 17px. At 17px or below, each component keeps its existing size. Standalone HTML exports keep their existing sizes.
    - **Advanced Tables**:
      - Click headers to **sort locally** (ascending / descending / reset) with smart parsing for numbers, currency, commas, percentages, and `k/m/b` units;
      - Columns support inline progress bars (`bar`), rings (`ring`), sparklines (`spark`), and badges;
      - One-click data export (Copy Markdown / CSV) and instant client-side text filtering (`filter`).
    - **ECharts Integration (`echart`)**:
      - **Preset Mode**: Shorthand presets (`bar`, `line`, `area`, `pie`, `scatter`, `radar`, `gauge`, `funnel`, `treemap`, `sankey`, `graph`, `heatmap`, `bigline`, `wordCloud`) that adapt automatically to host light/dark themes;
      - **Full Option Mode**: Full native ECharts options for advanced features like DataZoom and VisualMap;
      - **On-Demand Lazy Loading**: The ~1 MB ECharts engine is loaded asynchronously only when an `echart` block is encountered.
    - **Mathematical Function Plots (`plot`)**:
      - Multi-series plotting with expressions (trig, log, exp, power);
      - **Live Parameter Sliders**: Drag sliders to redraw curves instantly at 60 FPS; supports auto-animation loops.
    - **Mermaid & 3D Visuals**: Flowcharts, sequence diagrams, and lightweight 3D models with on-demand asset loading.
    - **Native Galleries**: `carousel` composes existing cards and forms in a responsive, keyboard-navigable horizontal track; `image-group` opens images in a local lightbox with focus restoration. Navigation does not invoke model actions. [Examples and verification](docs/gallery.md).
    - **Native Media**: Inline playback for accessible audio and video URLs, with poster images, aspect ratios, and controls.
    - **KaTeX Math Rendering**: Inline math (`$...$`) and display blocks (`$$...$$`), supporting matrices and multi-line equations.
    
    ### 3. ⚡ Local-First Responsiveness
    - **Zero-Latency Interactions**: State transitions that the frontend can handle alone (sorting, filtering, accordion toggling, slider redraws, tab switches) execute **entirely client-side** without round-trips to the model.
    - **Quizzes & Submission (`quiz` / `submit`)**:
      - Single quizzes evaluate instantly with explanations and retry options;
      - Multi-question assessments support batch grading and progress tracking with the `groups` schema.
    - **Durable Persistence**: User inputs, form fields, and quiz states persist across page reloads via session fingerprints (LRU cache of 200 blocks).
    
    ### 4. 🔄 Bidirectional Action Event Loop
    - **Closed-Loop Interactions**: Interactive elements equipped with an `action` payload package user events back to the model to trigger follow-up reasoning.
    - **Honest UI Guarantee**: Buttons without an `action` render disabled to eliminate "dead clicks"; active buttons show immediate visual feedback upon trigger.
    - **Debounced Delivery**: Discrete taps send immediately; continuous slider drags apply trailing-edge debounce to prevent message flooding.
    
    ### 5. 📌 Persistent Session Workspace & Templates
    - **Session Dock Panel**: Open a persistent dock above the composer via `/panel` or `panel: true`; resize by dragging its border; append tabs incrementally with `append: true`.
    - **Template Center & Badges**:
      - **Templates**: Browse 11 pre-built scenario templates directly from the dock to kickstart prompts;
      - **Achievements**: Unlock 12 built-in local exploration badges as you interact with various components.
    
    ### 6. 🛡️ Sandboxing, Guards & Self-Healing
    - **Security by Design**: Strictly whitelisted JSON components; zero script injection or `eval`; **strict prohibition of passwords or secret collection**.
    - **Same-Turn Fence Steering**: If a generated fence fails validation, diagnostic errors are fed back to the model within the **same turn** so it can self-correct (can be disabled via `fenceFeedback: false`).
    - **Resilient Fallbacks**: Malformed nodes are safely discarded while siblings render normally (single node errors never crash the fence); Mermaid syntax glitches are automatically repaired.
    
    ---
    
    ## 💻 Quick Examples
    
    ### Example 1: Executive KPI Dashboard
    
    The model emits the following `dsh-ui` code block:
    
    ```dsh-ui
    {
      "title": "Q3 2026 Executive Overview",
      "items": [
        {
          "type": "row",
          "items": [
            { "type": "stat", "label": "Total Revenue", "value": "¥128,430", "delta": "+12.4%", "spark": [40, 55, 60, 85, 120] },
            { "type": "stat", "label": "Completed Orders", "value": "1,024", "delta": "-3.1%", "spark": [90, 85, 80, 75, 70] },
            { "type": "progress", "label": "Quarterly Target", "value": 82, "variant": "ring" }
          ]
        }
      ]
    }
    ```
    
    ### Example 2: ECharts Revenue Trend
    
    ```dsh-ui
    {
      "title": "Revenue Breakdown",
      "items": [
        {
          "type": "echart",
          "title": "Monthly Performance",
          "preset": "bar",
          "data": [
            { "label": "Jan", "value": 98 },
            { "label": "Feb", "value": 112 },
            { "label": "Mar", "value": 128 },
            { "label": "Apr", "value": 145 },
            { "label": "May", "value": 160 }
          ]
        }
      ]
    }
    ```
    
    > For the comprehensive specification and full component catalog, refer to [SKILL.md](./SKILL.md).
    
    ---
    
    ## ⚙️ Architecture & How It Works
    
    ```mermaid
    sequenceDiagram
        autonumber
        actor User as User
        participant Host as DSH Host / LLM
        participant DOM as Conversation DOM
        participant GenUI as GenUI Client Renderer
        participant Assets as On-Demand Assets (ECharts/Three)
    
        User->>Host: Prompt (e.g. "Analyze recent order trends")
        Host-->>DOM: Streams Markdown prose & ```dsh-ui fence
        DOM->>GenUI: Detects fence and normalizes schema against whitelist
        alt Requires Heavy Engines
            GenUI->>Assets: Dynamically fetches engine bundles
            Assets-->>GenUI: Assets loaded
        end
        GenUI->>DOM: Mounts React component tree incrementally
        opt Client-Side Local Actions
            User->>GenUI: Sort table / Drag plot slider / Answer quiz
            GenUI-->>User: Instant sub-millisecond local update
        end
        opt Model Action Feedback
            User->>GenUI: Click interactive action button
            GenUI->>Host: Dispatches structured action payload
            Host-->>DOM: Model responds with next-step reasoning / updates panel
        end
    ```
    
    ### Artifact Exporting
    Completed GenUI blocks can be exported on demand:
    - **Standalone `.html`**: Inlines the lightweight renderer, CSS styles, KaTeX fonts, and required chart engines so the interactive UI can be viewed and tested offline in any browser.
    - **`.genui.json`**: Retains the normalized specification and durable interaction states for storage and portability.
    
    ---
    
    ## 🧑‍💻 Developer Guide
    
    ### Local Development (Link Mode)
    
    ```sh
    git clone https://github.com/omdsh-dev/dsh-genui.git
    cd dsh-genui
    pnpm install
    
    # Build and link into your DSH web profile
    dsh plugin --profile web add link:$PWD
    ```
    
    ### Useful Commands
    
    ```sh
    pnpm run check           # Type checks + full unit test suite + build
    pnpm run test            # Run Vitest unit tests
    pnpm run check:host-api dsh-v0.2.1-rc.3  # Check the retained rc.3 host API
    pnpm run check:host-api dsh-v0.2.1-rc.4  # Check the earlier rc.4 API
    pnpm run check:host-api dsh-v0.2.1-rc.5  # Check the current npm latest / next API, full suite and build
    pnpm run check:host-api dsh-v0.2.2-alpha.2  # Check the supported npm alpha API, full suite and build
    node scripts/verify-pack.mjs --keep  # Verify and inspect npm tarball
    ```
    
    ### End-to-End (E2E) Testing
    
    CI and the release workflow install `0.2.2-alpha.2` from npm with `node scripts/prepare-published-host.mjs 0.2.2-alpha.2`, then verify the packed plugin in a fresh web profile. This lane uses `DSH_HOST_LAYOUT=registry` and `DSH_HOST_VERSION=0.2.2-alpha.2` with the returned `DSH_ROOT` and `DSH_BIN`; the source-host lanes remain pinned to their official tags. The same registry-host lane also installs `0.2.1-rc.5`, with `DSH_HOST_VERSION=0.2.1-rc.5`. Both current RC and alpha API, gallery/computed and Linux Map checks must pass before npm publication. Actions use official local replay; Android device and original Windows Desktop acceptance remain separate.
    
    - **Visual E2E Smoke (No Model API Key Required)**:
      ```sh
      npx tsx scripts/e2e-visual.mts          # Boots headless Chrome, tests gallery rendering and asserts interactions
      ```
    - **Real-Model Integration E2E**:
      ```sh
      export DSH_ROOT=/path/to/deepseek-harness-0.2.1-rc.3
      export DSH_BIN="$DSH_ROOT/apps/cli/lib/bin.js"
      DEEPSEEK_API_KEY=sk-... node scripts/e2e.mjs
      ```
    
    ### Advanced Profile Configurations
    
    To customize plugin behaviors, add configurations under `cordis.patch.yml` in your profile:
    
    ```yaml
    - id: genui
      name: '@changfenhuang/dsh-genui'
      config:
        renderUiTool: false   # Disable registering the render_ui tool card (fences and panel remain active)
        fenceFeedback: false  # Disable automatic same-turn steer correction on malformed fences
    ```
    
    ### Embedding into Other Applications
    
    You can import `GenuiBlock`, `GenuiActionContext`, and `processGenuiSpec` from `@changfenhuang/dsh-genui/embed` to embed the renderer into any React application supporting CSS Modules.
    
    ### dsh-go integration
    
    The dsh-go integration uses the App’s existing native cards, inline choices and plugin panels; no App patch or replacement APK is needed. The complete web spec stays authoritative. Native panels support choices, switches, buttons, submissions, local grading, tabs, accordions, copy and confirmed HTTPS links. Validation can produce one JSON fence readable by both renderers. Panels currently require the local-engine dsh-go bridge; SSH and relay hosts retain native tool cards. Advanced graphics and free-text input remain explicit limitations. See [capabilities and verification](docs/dsh-go.md).
    
    ### Theming: non-opaque host canvases
    
    Every surface resolves through one chain: `--dsl-g-surface` → `--dsh-genui-surface` → `--dsw-alias-bg-layer-2` → … → `#fff`. A skin that paints the page itself (wallpaper, glass / translucent look) can pin the surface once without touching the host's own tokens:
    
    ```css
    :root { --dsh-genui-surface: rgba(255, 255, 255, 0.58); }
    body[data-ds-dark-theme] { --dsh-genui-surface: rgba(32, 32, 34, 0.54); }
    ```
    
    `callout` and toned `card` washes are painted *over* that surface, so they stay readable on any canvas. `card.flat` and `table` are surface-less by design (a printed block, a bare data grid) and would show a non-opaque page through — they fill only when a skin asks for it:
    
    ```css
    :root {
      --dsh-genui-surface: rgba(255, 255, 255, 0.58);      /* cards, callouts, controls */
      --dsh-genui-surface-flat: var(--dsh-genui-surface);  /* card.flat */
      --dsh-genui-surface-table: var(--dsh-genui-surface); /* table */
    }
    ```
    
    Leaving the last two unset keeps today's look (transparent table, 2.5% printed flat card); pointing them at `var(--dsh-genui-surface)` gives all three one fill. Wrapping a table in a `card` fills it too, since the parent surface shows through (issue #398).
    
    ---
    
    ### Sidechat surfaces (optional)
    
    GenUI can render settled `dsh-ui` fences on provider-declared sidechat surfaces. BetterSidebar uses its `registerSidechatSurfaceAdapter` capability; other providers can expose the optional `genuiSidechat` Cordis service. Each surface carries its owning thread identity and prompt callback, so actions and interaction state stay within that child thread. Streaming rows and unsupported or invalid fences keep their original Markdown.
    
    See [the sidechat surface adapter contract](docs/sidechat-surfaces.md). BetterSidebar support requires a release containing [its provider implementation](https://github.com/omdsh-dev/DSH-better-sidebar/pull/1033); the released 0.28.0 does not expose `registerSidechatSurfaceAdapter`. The DSH native Side Chat provider must expose `genuiSidechat` to enable this integration.
    
    ## ❓ FAQ & Troubleshooting
    
    <details>
    <summary><strong>Q: Why are dsh-ui fences still showing up as raw code blocks?</strong></summary>
    
    1. Open your browser Developer Tools (F12) and inspect the Console.
    2. Search for the log `[genui] client active; fence-channel=dom`:
       - **If missing**: The client bundle was not activated by the host. Verify that `dsh plugin list` shows the plugin as active, restart DSH web, and hard refresh your browser;
       - **If present**: Check whether the code block language identifier is strictly `dsh-ui` and that its body contains valid JSON.
    </details>
    
    <details>
    <summary><strong>Q: Error: "pnpm not found on PATH"?</strong></summary>
    
    DSH plugin management calls `pnpm` under the hood. Run `corepack enable` or `npm i -g pnpm`, then **open a new terminal window** before running `dsh plugin add`.
    </details>
    
    <details>
    <summary><strong>Q: npm install returns 404?</strong></summary>
    
    The package is public and requires no login. Verify the package name via `npm view @changfenhuang/dsh-genui version`. If a version was published very recently, allow a few moments for registry mirrors to synchronize.
    </details>
    
    <details>
    <summary><strong>Q: 3D scene, Mermaid, or ECharts does not render?</strong></summary>
    
    Heavier engines are lazy-loaded through plugin-provided static routes upon their first appearance. Hard refresh your browser (`Cmd + Shift + R`). If the issue persists, reinstall the package:
    ```sh
    dsh plugin --profile web remove @changfenhuang/dsh-genui
    dsh plugin --profile web add @changfenhuang/dsh-genui
    ```
    </details>
    
    <details>
    <summary><strong>Q: The chat screen goes blank when rendering a fence?</strong></summary>
    
    This version requires DSH `^0.2.0-rc.1 || ^0.2.1-rc.1 || ^0.2.2-alpha.2`. Older host versions lack necessary React slot/context capabilities; please upgrade DSH.
    </details>
    
    ---
    
    ## 🗺️ Roadmap Evaluation
    
    | Exploration Area | Decision | Rationale |
    | :--- | :---: | :--- |
    | **Incremental Diff Patching** | Declined | A fence costs only 200–800 tokens; resending is fast and safe. Teaching models a patch diff protocol introduces high friction and hallucination rates. |
    | **Granular Action Delivery** | ✅ Done | Discrete gestures send immediately; continuous slider drags apply trailing-edge debounce to keep chat context clean. |
    | **Cross-Session Replay Persistence** | Declined | Resetting on replay is the more natural expectation when the model updates the UI; state is preserved seamlessly during streaming. |
    | **Separate Gallery / i18n Strings** | Declined | The component gallery is covered by `demo-prompts`, `gallery.ts`, and README screenshots; the core bundle carries only 6 built-in UI strings. |
    
    ---
    
    ## 🔗 Links & Community
    
    - [Linux.do Community Discussion](https://linux.do)
    - Visit the [Live Product Site](https://omdsh-dev.github.io/dsh-genui/) to explore more demos.
    
    ---
    
    ## 📄 License
    
    This project is licensed under the [MIT License](LICENSE).
    
    ### Interactive maps
    
    The `map` node combines lazy MapLibre markers and inline routes with an
    always-available keyboard-operable location list. Selection stays local and can
    be persisted/submitted as a stable location ID through the existing fields
    contract. The default is an offline blank coordinate map, not a street basemap;
    external styles belong to trusted host configuration, never model JSON.
    See [the map contract and embedding/export guide](docs/map.md).
    
  • scripts/map-acceptance/README.md3.8 KB421eff50fa70upstream ↗
    # Real Map acceptance in existing CI
    
    The existing Linux host matrix runs `scripts/e2e.mjs --smoke --map --install
    tarball --tarball … --tarball-sha256 …`. It reuses the verified package, pinned
    DSH host and that host's Playwright. No new job, service, permission, credential,
    model subscription or browser dependency is introduced.
    
    This mode deliberately refuses local execution, non-Linux GitHub runners,
    root, live-model mode, unverified installation, and `--sidechat` combination.
    Do not work around a browser, socket or sandbox denial. The existing Gallery,
    Sidechat and text-newline tests remain separate and unchanged.
    
    ## Browser constraints
    
    Use installed official Chrome with `chromiumSandbox: true`. GPU-less runners
    use Chromium's supported ANGLE/SwiftShader OpenGL ES driver:
    `--use-gl=angle --use-angle=swiftshader`. This is not the unsafe WebGL fallback.
    No `--no-sandbox`, `--disable-gpu`, `--disable-web-security`,
    `--enable-unsafe-swiftshader`, CSP bypass or system security change is allowed.
    The running browser command line is inspected for forbidden flags. Browser or
    driver failure fails the job; there is no alternate channel or unsafe retry.
    
    References:
    - https://chromium.googlesource.com/chromium/src/+/HEAD/docs/gpu/swiftshader.md
    - https://playwright.dev/docs/api/class-browsertype#browser-type-launch-option-chromium-sandbox
    
    ## What a successful CI run establishes
    
    - Actual WebGL context and composited route pixels, corroborated by a real
      blob worker. The 80×32 central screenshot crop excludes the same-blue DOM
      markers, so markers alone cannot pass a broken GeoJSON worker.
    - Keyboard list → marker, marker → list, clear, zoom geometry, reset, ordinary
      wheel non-zoom behavior, and local selection without implicit actions.
    - On rc.3 only: a real isolated session via official APIs and ReplayAdapter;
      exactly one initial prompt, zero additional calls during navigation, then
      one explicit submit carrying `fields.destination = "east"`, one fresh input
      request, and the second real assistant acknowledgment. rc.1 explicitly gets
      DOM-fence visual/interaction coverage, not host action-routing credit.
    - Public `./embed` source and engine assets extracted from the exact verified
      tarball. Fixtures use public props/context/snapshot APIs, never internal
      stores or Map instances. Streaming IDs, removal, theme/style changes,
      worker cleanup and a narrow touch context are checked through actual UI.
    - A real UI-triggered public HTML export opened from the saved file in a fresh
      browser context that is offline before first navigation, then reloaded.
      Original CSP remains intact; no HTTP(S) or WebSocket dependency is allowed.
      The exported selection is restored; local controls work; model submit stays
      disabled. This file navigation is on CI, never a cloud CUA/file workaround.
    - A negative fixture adds `worker-src 'none'` without changing product CSP.
      Worker rejection must produce an honest usable list fallback and preserve
      explicit submit behavior; expected CSP evidence is recorded separately.
    
    ## Evidence and limits
    
    `.e2e-artifacts/map/map-browser-results.json` records identity, phase, renderer,
    pixel measurements, action verdicts, sanitized network/CSP/errors and cleanup.
    Named PNGs show host, embed, touch, offline and blocked-worker states. A failure
    keeps `map-failure.png` when possible; launch/outer failures write
    `map-runner-error.json`. The archive contains only synthetic JSON/PNGs and the
    synthetic exported HTML, not profiles, host logs, tokens or raw session audit.
    
    Local pure contract tests and fixture compilation are not browser acceptance.
    Until the new CI step actually runs successfully, real browser acceptance is
    pending. A software-GPU pass does not establish physical GPU/device coverage,
    all third-party host styles, or every worker crash/recovery path.
    
  • scripts/sidechat-acceptance/README.md4.9 KBc35137ed55caupstream ↗
    # Dual-plugin sidechat acceptance
    
    This test-only gate exercises packed GenUI and Better Sidebar through the real
    DSH host and browser. It uses a fresh synthetic workspace and HOME, loopback
    host authentication, and bounded deterministic replay. It does not use provider
    keys, customer data, a shared DSH profile, or a substitute renderer.
    
    ## Existing CI smoke integration
    
    The existing `check` job runs the pure contracts, then calls this gate from
    `scripts/e2e.mjs --smoke --sidechat --install tarball` before smoke success and browser
    closure. Without the explicit `--sidechat` option, all existing smoke/link/npm
    modes are unchanged and do not build or fetch the companion. `--sidechat` requires
    `--smoke --install tarball` before runtime setup. The gate reuses that caller-owned browser but creates and closes its own
    isolated context. There is no additional workflow, job, runner, or release.
    
    - Exact official source host `0.2.1-rc.3`: dual-plugin acceptance is mandatory in
      both the current Node 22 and Node 24 lanes. A missing/incomplete browser result,
      failed package installation, or failed cleanup fails the smoke job.
    - Official `0.2.0-rc.1`: the existing minimum-host GenUI smoke still runs. The
      dual-plugin verdict is explicitly `not-applicable`, never a dual-plugin PASS.
    - Any other host version fails closed until its coverage is deliberately reviewed.
    
    The GenUI tarball and digest come from the existing normal verification/pack
    step. The companion is fetched from the public
    [`sunxiuguo/DSH-better-sidebar` fork](https://github.com/sunxiuguo/DSH-better-sidebar)
    at immutable commit `cd1251be2d61a75aac0fa2054fc09cdee8f62f08`
    ([draft companion PR](https://github.com/omdsh-dev/DSH-better-sidebar/pull/1033)).
    A fresh owned checkout verifies that exact detached object, honors the pinned
    repository's `[email protected]`, and runs normal frozen install, typecheck, build, and
    pack. Exactly one expected pack is accepted; its manifest and SHA-256 are checked
    before the host's normal plugin-add path installs it. No script-skip, build
    approval, peer-policy, dependency-age, or package-manager override is applied.
    
    ## What the gate proves
    
    The host runner verifies the exact source-layout host graph, both packed plugin
    names/digests and their installed file bytes, both actual browser boot entries,
    persisted synthetic parent/child histories, and separate-process resume. The
    mandatory browser helper checks real main/sidebar rendering, state isolation
    across child switching and away/return, and four owning-child actions. Each
    action requires a positive transport response and fresh durable replay receipts;
    parent/away actions, duplicates, foreign routes and missing completed turns fail.
    PASS requires the final durable quiet reread and owned cleanup.
    
    The seed contains parent, A, B and one untouched empty root. Official rc.3 hides
    non-current blank rows and reuses the existing blank from the native workspace
    header **New session** control. The helper observes the correlated request and
    successful response, requires both to name that exact empty root, verifies it is
    visibly selected, and binds it once to the durable oracle. All subsequent reads
    require the same four sessions, zero new roots and zero relevant messages, model
    calls, actions or turns in the reused blank. Root/cwd/workspace ownership is
    checked independently. No backend selection or extra model action is used, and
    the original four child actions are unchanged.
    
    Pure Node contracts cover these guards and negative controls. They do not prove
    that a real browser or host invocation passed. Each actual CI run must establish
    its own browser verdict; uploading evidence alone never counts as acceptance.
    
    ## Local commands and evidence
    
    Run contracts without Git downloads, package installation, a host or browser:
    
    ```sh
    node --test scripts/sidechat-acceptance/tests/*.test.mjs
    ```
    
    To exercise real acceptance, first prepare the exact official source host and a
    normal GenUI pack, then use the existing smoke command with `DSH_ROOT`, `DSH_BIN`,
    `--sidechat --install tarball`, `--tarball` and `--tarball-sha256`. The current-host gate also
    performs the ordinary companion build described above; it has no fallback to a
    backend-only or artifact-only success.
    
    The same CI job retains only these bounded synthetic files for seven days in a
    Node/role-specific artifact:
    
    - `.e2e-artifacts/sidechat/dsh354-thread-A-block2-fence1.png`
    - `.e2e-artifacts/sidechat/dsh354-thread-B-block0-fence1.png`
    - `.e2e-artifacts/sidechat/dsh354-main-unchanged.png`
    - `.e2e-artifacts/sidechat/dsh354-thread-B-after-actions.png`
    - `.e2e-artifacts/sidechat/dsh354-host-verdict.json`
    - `.e2e-artifacts/sidechat/dsh354-browser-report.json`
    
    No runtime HOME, session/config directory, raw host log, token, or build output is
    included by this new artifact step. The existing unrelated failure-artifact step
    is unchanged. Owned temporary checkout/profile/process resources are cleaned on
    success and failure; the wrapper never closes the caller's browser itself.
    
  • scripts/build-anthology-page.mts1.8 KB01203bbac1f0upstream ↗
    #!/usr/bin/env -S npx tsx
    /**
     * C2(选集美学纲领):从 gallerySpec 生成 GitHub Pages 选集页。
     *
     * 链路:gallerySpec → createGenuiArtifact → createStandaloneHtmlDocument
     * (bundles 由本脚本从 lib/assets/ 读文件注入——浏览器导出走 fetch,node 里
     * 直接读盘,同一纯函数两个来源)→ site/anthology.html。
     * site/** 由 deploy-product-site.yml 自动部署到 GitHub Pages,零新增基建。
     *
     * 前置:先 `pnpm build`——standalone-runtime.js 内嵌渲染器,旧产物不含新字段。
     * 用法:npx tsx scripts/build-anthology-page.mts
     */
    import { mkdirSync, readFileSync, writeFileSync } from 'node:fs'
    import { dirname, join, resolve } from 'node:path'
    import { fileURLToPath } from 'node:url'
    
    import { gallerySpec } from '../src/client/gallery.ts'
    import { createGenuiArtifact } from '../src/client/artifact/create.ts'
    import { createStandaloneHtmlDocument } from '../src/client/artifact/html.ts'
    import { analyzeGenuiPortability } from '../src/client/artifact/portability.ts'
    
    const REPO = resolve(dirname(fileURLToPath(import.meta.url)), '..')
    const PAGES_BASE = 'https://omdsh-dev.github.io/dsh-genui/'
    
    const artifact = createGenuiArtifact(gallerySpec, undefined, { locale: 'zh', theme: 'light' })
    const names = [...analyzeGenuiPortability(gallerySpec).requiredAssets.map(name => `${name}.js`), 'standalone-runtime.js']
    const bundles = new Map(names.map(name => [name, new Uint8Array(readFileSync(join(REPO, 'lib/assets', name)))]))
    const html = createStandaloneHtmlDocument(artifact, bundles, PAGES_BASE)
    
    mkdirSync(join(REPO, 'site'), { recursive: true })
    writeFileSync(join(REPO, 'site/anthology.html'), html)
    console.log(`✓ site/anthology.html written (${(html.length / 1024 / 1024).toFixed(2)} MB, engines: ${names.join(', ')})`)
    
  • scripts/check-blocks-theme-browser.mjs9.6 KB6e2bf57ec97fupstream ↗
    #!/usr/bin/env node
    /** #408: actual Chromium, real renderer, synthetic confusion matrix.
     * BROWSER_BIN=chromium node scripts/check-blocks-theme-browser.mjs
     * Optional GENUI_HOST_THEME_CSS injects a real host token sheet, independently
     * of the export fallback. GENUI_BROWSER_OUT retains before/after evidence.
     * GENUI_BLOCKS_CSS can render an immutable baseline sheet with the same fixture.
     */
    import assert from 'node:assert/strict'
    import { spawn } from 'node:child_process'
    import { mkdir, mkdtemp, readFile, rm, writeFile } from 'node:fs/promises'
    import { tmpdir } from 'node:os'
    import { dirname, join, resolve } from 'node:path'
    import { fileURLToPath } from 'node:url'
    import { createServer } from 'vite'
    
    const root = resolve(dirname(fileURLToPath(import.meta.url)), '..')
    const out = resolve(process.env.GENUI_BROWSER_OUT ?? join(root, '.e2e-artifacts/blocks-theme'))
    const browser = process.env.BROWSER_BIN ?? 'chromium'
    const hostCss = process.env.GENUI_HOST_THEME_CSS ? await readFile(process.env.GENUI_HOST_THEME_CSS, 'utf8') : null
    const failures = []
    const check = (condition, message) => { if (!condition) failures.push(message) }
    const pause = ms => new Promise(resolve => setTimeout(resolve, ms))
    
    /** CDP waits for the fixture rather than Chromium's dump-dom load heuristic.
     * Vite modules (and optional host tokens) finish asynchronously after load. */
    async function render(url, screenshot) {
      const profile = await mkdtemp(join(tmpdir(), 'genui-blocks-chrome-'))
      const process = spawn(browser, [
        '--headless=new', '--no-sandbox', '--disable-dev-shm-usage', '--disable-gpu',
        '--disable-background-networking', '--disable-extensions', '--disable-sync', '--no-first-run',
        `--user-data-dir=${profile}`, '--remote-debugging-port=0', 'about:blank',
      ], { stdio: ['ignore', 'ignore', 'pipe'] })
      let stderr = ''
      process.stderr.on('data', chunk => { stderr += chunk })
      let socket
      try {
        let port
        for (let i = 0; i < 100; i++) {
          try { port = (await readFile(join(profile, 'DevToolsActivePort'), 'utf8')).split('\n')[0]; break } catch { await pause(100) }
        }
        assert.ok(port, `Chromium CDP did not start: ${stderr}`)
        const targets = await (await fetch(`http://127.0.0.1:${port}/json/list`)).json()
        socket = new WebSocket(targets.find(target => target.type === 'page').webSocketDebuggerUrl)
        await new Promise((resolve, reject) => { socket.onopen = resolve; socket.onerror = reject })
        let next = 0
        const pending = new Map()
        socket.onmessage = event => {
          const message = JSON.parse(event.data)
          if (message.id) pending.get(message.id)?.(message)
        }
        const command = (method, params = {}) => new Promise((resolve, reject) => {
          const id = ++next
          const timer = setTimeout(() => { pending.delete(id); reject(new Error(`CDP timeout: ${method}`)) }, 10000)
          pending.set(id, message => {
            clearTimeout(timer)
            pending.delete(id)
            if (message.error) reject(new Error(JSON.stringify(message.error)))
            else resolve(message.result)
          })
          socket.send(JSON.stringify({ id, method, params }))
        })
        const evaluate = async expression => (await command('Runtime.evaluate', { expression, returnByValue: true })).result.value
        await command('Emulation.setDeviceMetricsOverride', { width: 1100, height: 1300, deviceScaleFactor: 1, mobile: false })
        await command('Page.navigate', { url })
        let ready = false
        for (let i = 0; i < 150; i++) {
          ready = await evaluate("Boolean(document.getElementById('results') && document.getElementById('results').textContent !== 'pending')")
          if (ready) break
          const error = await evaluate("document.getElementById('browser-errors')?.textContent")
          assert.ok(!error, `Browser fixture error: ${error}`)
          await pause(100)
        }
        assert.ok(ready, `Browser fixture did not finish: ${stderr}`)
        await command('Runtime.evaluate', { expression: 'document.fonts.ready', awaitPromise: true })
        await command('Runtime.evaluate', {
          expression: 'Promise.all(document.getAnimations().filter(a => Number.isFinite(a.effect.getComputedTiming().endTime)).map(a => a.finished.catch(() => {})))',
          awaitPromise: true,
        })
        const shot = await command('Page.captureScreenshot', { captureBeyondViewport: true })
        await writeFile(screenshot, Buffer.from(shot.data, 'base64'))
        return { stdout: await evaluate('document.documentElement.outerHTML'), stderr }
      } finally {
        socket?.close()
        process.kill('SIGTERM')
        for (let i = 0; i < 30 && process.exitCode === null; i++) await pause(100)
        if (process.exitCode === null) process.kill('SIGKILL')
        await rm(profile, { recursive: true, force: true })
      }
    }
    const server = await createServer({
      root, configFile: false,
      plugins: [{ name: 'blocks-theme-fixture', enforce: 'pre', async load(id) {
        if (process.env.GENUI_BLOCKS_CSS && id === resolve(root, 'src/client/GenuiBlock.module.css')) {
          return await readFile(process.env.GENUI_BLOCKS_CSS, 'utf8')
        }
      }, configureServer(server) {
        server.middlewares.use('/__host-theme.css', (_req, res) => {
          res.statusCode = hostCss === null ? 404 : 200
          res.setHeader('Content-Type', 'text/css')
          res.end(hostCss ?? '')
        })
      } }],
      server: { host: '127.0.0.1', port: 0, strictPort: true, watch: { ignored: ['**/.e2e-artifacts/**'] } },
      resolve: {
        dedupe: ['react', 'react-dom'],
        alias: [{ find: /^(?:.*\/)?primitive-adapter\.ts$/, replacement: resolve(root, 'src/client/standalone/primitive-adapter.tsx') }],
      },
      optimizeDeps: { entries: ['tests/browser/blocks-theme.html'], include: ['react', 'react/jsx-runtime', 'react/jsx-dev-runtime', 'react-dom', 'react-dom/client', 'katex'] },
    })
    await mkdir(out, { recursive: true })
    try {
      await server.listen()
      const address = server.httpServer.address()
      assert.ok(address && typeof address !== 'string')
      for (const palette of hostCss === null ? ['export'] : ['host', 'export']) {
        for (const theme of ['light', 'dark']) {
          const name = `${palette}-${theme}`
          const { stdout, stderr } = await render(
            `http://127.0.0.1:${address.port}/tests/browser/blocks-theme.html?theme=${theme}&palette=${palette}`,
            join(out, `${name}.png`),
          )
          await writeFile(join(out, `${name}.log`), stderr)
          await writeFile(join(out, `${name}.html`), stdout)
          const dom = new (await import('jsdom')).JSDOM(stdout).window.document
          assert.equal(dom.getElementById('browser-errors')?.textContent, '', `${name}: browser errors`)
          const raw = dom.getElementById('results')?.textContent
          assert.ok(raw && raw !== 'pending', `${name}: fixture did not finish`)
          const results = JSON.parse(raw)
          await writeFile(join(out, `${name}.json`), JSON.stringify(results, null, 2) + '\n')
          assert.equal(results.length, 47, `${name}: real renderer cell count`)
          for (const cell of results) {
            const label = `${name}/${cell.name}/${cell.text}`
            check(cell.contrast >= 4.5, `${label}: text contrast ${cell.contrast.toFixed(2)} < 4.5`)
            check(cell.sharedStrong === '14%', `${label}: shared focus/data accent strength changed`)
            check(cell.sharedTint === (theme === 'dark' ? '18%' : '12%'), `${label}: unrelated semantic surface strength changed`)
            if (!cell.tone && (cell.outline || cell.plain)) check(cell.background[3] === 0, `${label}: unmarked outline/plain must remain unfilled`)
            if (cell.tone && cell.plain) check(cell.borderWidth === '0px', `${label}: plain tone must have no border`)
            if (theme === 'dark' && cell.tone && cell.text !== 'Cell fill') {
              check(cell.background[3] >= 0.27, `${label}: dark semantic wash must remain visible`)
              if (cell.tone !== 'muted') {
                const chroma = Math.max(...cell.effective.slice(0, 3)) - Math.min(...cell.effective.slice(0, 3))
                // The rc.3 accent is a lighter, less saturated blue than the
                // success/error hues. All keep a >=35/255 channel spread on
                // these default backdrops (the original accent was ~26/255).
                check(chroma >= 35, `${label}: dark semantic chroma ${chroma.toFixed(1)} < 35`)
              }
              if (!cell.plain) check(cell.border[3] >= 0.49, `${label}: dark semantic boundary too faint`)
            }
            if (cell.name === 'variants' && cell.text === 'Default' && !cell.outline && !cell.plain) {
              check(Math.abs(cell.background[3] - (theme === 'dark' ? 0.28 : 0.14)) < 0.01, `${label}: default fill strength`)
            }
            if (theme === 'light' && cell.tone && cell.text !== 'Cell fill') {
              check(Math.abs(cell.background[3] - 0.12) < 0.01, `${label}: light tone wash must remain unchanged`)
              if (!cell.plain) check(Math.abs(cell.border[3] - 0.3) < 0.01, `${label}: light boundary must remain unchanged`)
            }
          }
          const tones = results.filter(cell => cell.name === 'variants' && !cell.plain && !cell.outline && cell.tone)
          check(new Set(tones.map(cell => JSON.stringify(cell.effective))).size === 5, `${name}: all five tones must remain distinct`)
          const explicit = results.find(cell => cell.text === 'Cell fill')
          check(explicit.background.join(',') === '31,111,122,1', `${name}: explicit cell fill must win over tone`)
          const row = results.find(cell => cell.text === 'Row fill')
          check(row.background.join(',') === '226,232,240,1', `${name}: explicit row fill must remain unchanged`)
          await readFile(join(out, `${name}.png`))
          console.log(`${name}: measured ${results.length} cells; min text contrast ${Math.min(...results.map(cell => cell.contrast)).toFixed(2)}:1`)
        }
      }
      assert.deepEqual(failures, [], 'Semantic blocks browser regression')
      console.log('Chromium semantic blocks check passed')
    } finally { await server.close() }
    
  • scripts/check-content-font-size-browser.mjs1.9 KB25e158fbea39upstream ↗
    import assert from 'node:assert/strict'
    import { execFileSync } from 'node:child_process'
    import { mkdtempSync, rmSync } from 'node:fs'
    import { tmpdir } from 'node:os'
    import { join, resolve } from 'node:path'
    import { pathToFileURL } from 'node:url'
    import { JSDOM } from 'jsdom'
    
    const browser = process.env.BROWSER_BIN ?? (process.platform === 'darwin' ? '/Applications/Google Chrome.app/Contents/MacOS/Google Chrome' : 'google-chrome')
    let checked = 0
    for (const fixtureName of ['content-font-size.html', 'plot-content-font-size.html']) {
      const fixture = pathToFileURL(resolve('tests/browser', fixtureName)).href
      const profile = mkdtempSync(join(tmpdir(), 'dsh-genui-font-browser-'))
      let output
      try {
        output = execFileSync(browser, [
          '--headless', '--no-sandbox', '--disable-gpu', '--disable-background-networking', '--no-first-run',
          '--password-store=basic', '--use-mock-keychain', `--user-data-dir=${profile}`, '--dump-dom', fixture,
        ], { encoding: 'utf8', timeout: 30000 })
      } finally {
        rmSync(profile, { recursive: true, force: true })
      }
      const document = new JSDOM(output).window.document
      const results = JSON.parse(document.getElementById('results').textContent)
      const rootCount = fixtureName === 'content-font-size.html' ? 2 : 1
      assert.equal(results.samples.length, rootCount * Object.keys(results.tokenSizes).length * 6)
      for (const sample of results.samples) {
        const originalSize = results.tokenSizes[sample.token]
        const expectedSize = Math.max(originalSize, originalSize * (sample.contentSize ?? 14) / 17)
        assert.ok(Number.isFinite(sample.fontSize), `${sample.root}/${sample.token}/${sample.contentSize}: invalid font size`)
        assert.ok(Math.abs(sample.fontSize - expectedSize) < 0.03, `${sample.root}/${sample.token}/${sample.contentSize}: ${sample.fontSize}px, expected ${expectedSize}px`)
      }
      checked += results.samples.length
    }
    console.log(`Host content font size browser check passed: ${checked} computed styles`)
    
  • scripts/check-host-api.mjs5.0 KB43b0f2cdec68upstream ↗
    import assert from 'node:assert/strict'
    import { execFileSync } from 'node:child_process'
    import { cp, mkdir, mkdtemp, readFile, rm, writeFile } from 'node:fs/promises'
    import { dirname, join, resolve } from 'node:path'
    import { tmpdir } from 'node:os'
    import { fileURLToPath } from 'node:url'
    import { minVersion, satisfies } from 'semver'
    import { parse, stringify } from 'yaml'
    import { mergeExactVersionExceptions } from './host-dependency-policy.mjs'
    
    const repoRoot = resolve(dirname(fileURLToPath(import.meta.url)), '..')
    const hostRef = process.argv[2]
    assert.match(hostRef ?? '', /^dsh-v\d+\.\d+\.\d+(?:-(?:alpha|beta|rc)\.\d+)?$/, '需要明确的 DSH 发布标签')
    const version = hostRef.slice('dsh-v'.length)
    const pkg = JSON.parse(await readFile(join(repoRoot, 'package.json'), 'utf8'))
    const host = JSON.parse(execFileSync('pnpm', ['view', `@deepseek-ai/dsh@${version}`, '--json'], { encoding: 'utf8' }))
    assert.equal(host.name, '@deepseek-ai/dsh')
    assert.equal(host.version, version)
    assert.ok(satisfies(process.versions.node, host.engines?.node ?? '*'), 'Node must satisfy the selected host runtime')
    const core = ['@deepseek-ai/cordis', '@deepseek-ai/cordis-plugin-include', '@deepseek-ai/cordis-plugin-loader']
      .filter(name => host.dependencies[name] !== undefined)
      .map(name => {
        const exact = minVersion(host.dependencies[name])
        assert.ok(exact, `Expected a versioned host dependency: ${name}`)
        return `${name}@${exact.version}`
      })
    const toolExports = JSON.parse(execFileSync('pnpm', ['view', `@deepseek-ai/dsh-tools@${version}`, 'exports', '--json'], { encoding: 'utf8' }))
    const dshPackages = [...new Set([
      ...Object.keys(pkg.peerDependencies),
      ...Object.keys(pkg.devDependencies),
    ])].filter(name => name.startsWith('@deepseek-ai/dsh-'))
    if (toolExports['./pipeline'] !== undefined) dshPackages.push('@deepseek-ai/dsh-tool-executor-native')
    const checkRoot = await mkdtemp(join(tmpdir(), 'dsh-genui-host-api-'))
    
    try {
      for (const name of ['package.json', 'pnpm-lock.yaml', 'pnpm-workspace.yaml', '.npmrc', 'tsconfig.json', 'tsdown.config.ts', 'vitest.config.ts', 'SKILL.md']) {
        await cp(join(repoRoot, name), join(checkRoot, name))
      }
      await cp(join(repoRoot, 'src'), join(checkRoot, 'src'), { recursive: true })
      await cp(join(repoRoot, 'tests'), join(checkRoot, 'tests'), { recursive: true })
      // e2e-auth 等测试按 cwd 相对路径读取 scripts/ 源码,隔离目录需要一并拷贝
      await cp(join(repoRoot, 'scripts'), join(checkRoot, 'scripts'), { recursive: true })
      // Map 的 CI/发布契约测试读取真实工作流;只复制需要的工作流输入。
      await mkdir(join(checkRoot, '.github/workflows'), { recursive: true })
      await cp(join(repoRoot, '.github/workflows/ci.yml'), join(checkRoot, '.github/workflows/ci.yml'))
      await cp(join(repoRoot, '.github/workflows/release.yml'), join(checkRoot, '.github/workflows/release.yml'))
    
      // 所有直接 DSH 依赖统一到目标版本,避免测试辅助包把另一版宿主混入检查。
      // pnpm 在隔离目录安装发布包,源码中的 import 由该目录的 node_modules 解析。
      // hostRuntimeClosure:发布宿主包在真实 App 内运行,部分 import 未在包内声明
      // (如 ui-primitives 直接 import clsx/shiki/simple-icons,client-store import
      // zustand/immer)。真实宿主由 App 外层提供这些依赖,隔离目录必须显式补齐,
      // 否则 vite 在模块加载阶段以 "Failed to resolve import" 拒绝整批测试文件。
      // 新宿主引入新的幽灵依赖时 vitest 会点名报错,届时在此追加。
      const hostRuntimeClosure = [
        'clsx', 'simple-icons', 'shiki', '@shikijs/langs', 'anser', 'diff',
        'mdast-util-gfm', 'mdast-util-math', 'micromark-extension-gfm',
        'micromark-extension-math', 'zustand', 'immer',
      ]
      execFileSync('pnpm', ['add', '--save-dev', '--save-exact',
        ...core,
        ...dshPackages.map(name => `${name}@${version}`),
        ...hostRuntimeClosure.map(name => `${name}@${pkg.devDependencies[name]}`),
      ], { cwd: checkRoot, stdio: 'inherit' })
      const policyFile = join(checkRoot, 'pnpm-workspace.yaml')
      const policy = parse(await readFile(policyFile, 'utf8'))
      policy.minimumReleaseAgeExclude = mergeExactVersionExceptions(policy.minimumReleaseAgeExclude ?? [])
      await writeFile(policyFile, stringify(policy))
      for (const name of dshPackages) {
        const installed = JSON.parse(await readFile(join(checkRoot, 'node_modules', name, 'package.json'), 'utf8'))
        assert.equal(installed.version, version, `${name} 必须使用 ${version} 的公开类型`)
      }
      execFileSync('pnpm', ['exec', 'tsc', '-p', 'tsconfig.json'], { cwd: checkRoot, stdio: 'inherit' })
      // 全量套件使用已安装宿主的公开类型和运行依赖执行。
      execFileSync('pnpm', ['exec', 'vitest', 'run'], { cwd: checkRoot, stdio: 'inherit' })
      execFileSync('pnpm', ['exec', 'tsdown'], { cwd: checkRoot, stdio: 'inherit' })
      console.log(`${hostRef} API typecheck、全量单元测试与 tsdown build 通过`)
    } finally {
      await rm(checkRoot, { recursive: true, force: true })
    }
    
  • scripts/check-interaction-state-browser.mjs9.0 KB0d944288e19cupstream ↗
    #!/usr/bin/env node
    // Native focus and date input behavior cannot be established by jsdom alone.
    import assert from 'node:assert/strict'
    import { spawn } from 'node:child_process'
    import { mkdir, mkdtemp, readFile, rm, writeFile } from 'node:fs/promises'
    import { tmpdir } from 'node:os'
    import { dirname, join, resolve } from 'node:path'
    import { fileURLToPath } from 'node:url'
    import { createServer } from 'vite'
    
    const root = resolve(dirname(fileURLToPath(import.meta.url)), '..')
    const out = resolve(process.env.GENUI_BROWSER_OUT ?? join(root, '.e2e-artifacts/interaction-state'))
    const pause = ms => new Promise(resolve => setTimeout(resolve, ms))
    const server = await createServer({
      root, configFile: false,
      server: { host: '127.0.0.1', watch: { ignored: ['**/.e2e-artifacts/**'] } },
      resolve: {
        dedupe: ['react', 'react-dom'],
        alias: [{ find: /^(?:.*\/)?primitive-adapter\.ts$/, replacement: resolve(root, 'src/client/standalone/primitive-adapter.tsx') }],
      },
      optimizeDeps: { entries: ['tests/browser/interaction-state.html'], include: ['react', 'react/jsx-runtime', 'react/jsx-dev-runtime', 'react-dom', 'react-dom/client', 'katex'] },
    })
    const profile = await mkdtemp(join(tmpdir(), 'genui-interaction-chrome-'))
    let browser, socket
    const errors = []
    try {
      await mkdir(out, { recursive: true })
      await server.listen()
      const address = server.httpServer.address()
      browser = spawn(process.env.BROWSER_BIN ?? 'chromium', [
        '--headless=new', '--no-sandbox', '--disable-dev-shm-usage', '--disable-gpu',
        '--disable-background-networking', '--disable-extensions', '--disable-sync', '--no-first-run',
        `--user-data-dir=${profile}`, '--remote-debugging-port=0', 'about:blank',
      ], { stdio: 'ignore' })
      let port
      for (let i = 0; i < 100; i++) {
        try { port = (await readFile(join(profile, 'DevToolsActivePort'), 'utf8')).split('\n')[0]; break } catch { await pause(100) }
      }
      assert.ok(port, 'Chromium CDP did not start')
      const targets = await (await fetch(`http://127.0.0.1:${port}/json/list`)).json()
      socket = new WebSocket(targets.find(target => target.type === 'page').webSocketDebuggerUrl)
      await new Promise((resolve, reject) => { socket.onopen = resolve; socket.onerror = reject })
      let next = 0
      const pending = new Map()
      socket.onmessage = event => {
        const message = JSON.parse(event.data)
        if (message.id) pending.get(message.id)?.(message)
        if (message.method === 'Runtime.exceptionThrown') errors.push(message.params.exceptionDetails.exception?.description ?? message.params.exceptionDetails.text)
      }
      const command = (method, params = {}) => new Promise((resolve, reject) => {
        const id = ++next
        const timer = setTimeout(() => { pending.delete(id); reject(new Error(`CDP timeout: ${method}`)) }, 10000)
        pending.set(id, message => {
          clearTimeout(timer); pending.delete(id)
          if (message.error) reject(new Error(JSON.stringify(message.error)))
          else resolve(message.result)
        })
        socket.send(JSON.stringify({ id, method, params }))
      })
      const evaluate = async expression => {
        const result = await command('Runtime.evaluate', { expression, returnByValue: true, awaitPromise: true })
        assert.ok(!result.exceptionDetails, result.exceptionDetails?.exception?.description)
        return result.result.value
      }
      const waitFor = async (expression, label) => {
        for (let i = 0; i < 150; i++) {
          if (await evaluate(expression)) return
          assert.deepEqual(errors, [], 'Browser runtime errors')
          await pause(100)
        }
        assert.fail(`Timed out: ${label}`)
      }
      const mount = async (items, reset = true) => {
        await evaluate(`window.genuiInteraction.mount(${JSON.stringify({ items })}, ${reset})`)
        await pause(100)
      }
      const click = async selector => {
        const point = await evaluate(`(() => { const r = document.querySelector(${JSON.stringify(selector)}).getBoundingClientRect(); return {x:r.x+r.width/2,y:r.y+r.height/2} })()`)
        for (const type of ['mousePressed', 'mouseReleased']) await command('Input.dispatchMouseEvent', { type, ...point, button: 'left', clickCount: 1 })
      }
      const submit = { type: 'submit', label: 'Send', action: 'send' }
      const send = () => evaluate("[...document.querySelectorAll('button')].find(b => b.textContent === 'Send').click()")
      await command('Runtime.enable')
      await command('Emulation.setDeviceMetricsOverride', { width: 900, height: 800, deviceScaleFactor: 1, mobile: false })
      await command('Page.navigate', { url: `http://127.0.0.1:${address.port}/tests/browser/interaction-state.html` })
      await waitFor('Boolean(window.genuiInteraction)', 'fixture load')
    
      await mount([
        { type: 'input', id: 'name', label: 'Name', action: 'saveName' },
        { type: 'popover', label: 'Hover info', content: 'Details', trigger: 'hover' },
      ])
      await evaluate("document.querySelector('input').focus()")
      await command('Input.insertText', { text: 'Ada' })
      const point = await evaluate("(() => { const r = document.querySelector('[data-genui-popover] button').getBoundingClientRect(); return {x:r.x+r.width/2,y:r.y+r.height/2} })()")
      await command('Input.dispatchMouseEvent', { type: 'mouseMoved', ...point })
      await waitFor("Boolean(document.querySelector('[role=dialog]'))", 'hover popover')
      assert.equal(await evaluate('document.activeElement.tagName'), 'INPUT', 'Hover must preserve the active draft focus')
      assert.deepEqual(await evaluate('window.genuiInteraction.events'), [], 'Hover must not emit a blur action')
      assert.equal(await evaluate("document.querySelector('[role=dialog]').getAttribute('aria-label')"), 'Hover info')
      await writeFile(join(out, 'hover-focus.png'), Buffer.from((await command('Page.captureScreenshot')).data, 'base64'))
      for (const type of ['keyDown', 'keyUp']) await command('Input.dispatchKeyEvent', { type, key: 'Escape', code: 'Escape', windowsVirtualKeyCode: 27 })
      await waitFor("!document.querySelector('[role=dialog]')", 'Escape dismiss')
    
      await mount([{ type: 'popover', label: 'Click info', content: 'Details' }])
      await click('[data-genui-popover] button')
      await waitFor("document.activeElement?.closest('[role=dialog]') !== null", 'click focus')
      await click('[role=dialog] button')
      await waitFor("!document.querySelector('[role=dialog]')", 'close button')
    
      const gated = { type: 'popover', label: 'Gated info', content: '[Link](https://example.com)', enableWhen: { field: 'allow', op: 'eq', value: 'yes' } }
      await mount([gated, { type: 'input', id: 'allow', value: 'yes' }])
      await click('[data-genui-popover] button')
      await waitFor("Boolean(document.querySelector('[role=dialog]'))", 'enabled portal')
      await mount([{ ...gated, enableWhen: { field: 'allow', op: 'eq', value: 'no' } }, { type: 'input', id: 'allow', value: 'yes' }], false)
      assert.equal(await evaluate("Boolean(document.querySelector('[role=dialog]'))"), false, 'Disabled popover must remove its portal')
    
      for (const id of ['constructor', 'toString', '__proto__']) {
        await mount([{ type: 'editor', id, label: 'Draft', value: 'Hello' }, submit])
        assert.equal(await evaluate("document.querySelector('textarea').value"), 'Hello')
        await send()
        assert.deepEqual(await evaluate('window.genuiInteraction.events[0].payload.fields'), { [id]: 'Hello' })
        await mount([{ type: 'date-picker', id, label: 'Date', value: '2026-10-20' }, submit])
        assert.equal(await evaluate("document.querySelector('input').value"), '2026-10-20')
        await send()
        assert.deepEqual(await evaluate('window.genuiInteraction.events[0].payload.fields'), { [id]: '2026-10-20' })
      }
      await mount([{ type: 'date-picker', id: 'date', label: 'Date', value: '0000-01-01' }, submit])
      assert.equal(await evaluate("document.querySelector('input').value"), '')
      assert.equal(await evaluate("document.querySelector('button').disabled"), true)
    
      const date = { type: 'date-picker', id: 'date', label: 'Date', max: '2026-10-22' }
      await mount([date, submit])
      await evaluate("(() => { const input=document.querySelector('input'); Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,'value').set.call(input,'2026-10-30'); input.dispatchEvent(new Event('input',{bubbles:true})); input.dispatchEvent(new Event('change',{bubbles:true})); })()")
      assert.equal(await evaluate("document.querySelector('button').disabled"), true)
      await mount([{ ...date, max: '2026-10-31' }, submit], false)
      assert.equal(await evaluate("document.querySelector('input').value"), '2026-10-30')
      await send()
      assert.deepEqual(await evaluate('window.genuiInteraction.events[0].payload.fields'), { date: '2026-10-30' })
      assert.deepEqual(errors, [], 'Browser runtime errors')
      await writeFile(join(out, 'result.json'), JSON.stringify({ passed: true, cases: ['hover focus and no action', 'click focus', 'Escape and close', 'disabled portal removal', 'editor and date prototype keys', 'year zero', 'expanded date bounds'] }, null, 2) + '\n')
      console.log('Chromium interaction state checks passed')
    } finally {
      socket?.close()
      browser?.kill('SIGTERM')
      for (let i = 0; i < 30 && browser?.exitCode === null; i++) await pause(100)
      if (browser?.exitCode === null) browser.kill('SIGKILL')
      await server.close()
      await rm(profile, { recursive: true, force: true })
    }
    
  • scripts/check-map-assets.mjs1.2 KBb006088654fbupstream ↗
    /** Verify the shipped map engine stays lazy, with worker/CSS payloads intact. */
    import { readFile } from 'node:fs/promises'
    import { runInNewContext } from 'node:vm'
    const root = new URL('../', import.meta.url)
    const engine = await readFile(new URL('lib/assets/maplibre.js', root), 'utf8')
    for (const file of ['lib/client.js', 'lib/assets/standalone-runtime.js']) {
      const runtime = await readFile(new URL(file, root), 'utf8')
      if (runtime.includes('maplibregl-ctrl-attrib') || runtime.includes('MapLibre GL JS')) {
        throw new Error(`${file} eagerly contains the map engine or vendor CSS`)
      }
    }
    if (!engine.includes('maplibregl-ctrl-attrib') || !engine.includes('MapLibre GL JS')) {
      throw new Error('maplibre asset is missing vendor CSS/main/worker content')
    }
    const sandbox = {
      console, TextDecoder, TextEncoder,
      URL: { createObjectURL() { throw new Error('worker Blob was created before map mount') } },
    }
    // Asset evaluation alone must neither create a worker nor touch the DOM.
    runInNewContext(engine, sandbox, { timeout: 5000 })
    if (typeof sandbox.__GenuiAssets__?.maplibre?.mountMap !== 'function') {
      throw new Error('maplibre asset did not register its engine API')
    }
    console.log('lazy map asset check passed (not a real WebGL acceptance test)')
    
  • scripts/check-mermaid-browser.mjs22 KB1d9ed06e0f61upstream ↗
    #!/usr/bin/env node
    /** Real Chromium regression/benchmark for #303. No host, model or new dependency.
     * BROWSER_BIN=/path/to/chrome node scripts/check-mermaid-browser.mjs [--baseline REF]
     * Baselines are loaded from Git into virtual modules; the checkout stays intact.
     */
    import { spawn, execFileSync } from 'node:child_process'
    import { mkdtemp, mkdir, writeFile, rm } from 'node:fs/promises'
    import { tmpdir } from 'node:os'
    import { resolve, join, dirname } from 'node:path'
    import { fileURLToPath } from 'node:url'
    import { createServer } from 'vite'
    
    const root = fileURLToPath(new URL('../', import.meta.url))
    const out = resolve(root, '.e2e-artifacts/mermaid')
    const baseline = process.argv.includes('--baseline')
      ? process.argv[process.argv.indexOf('--baseline') + 1]
      : 'f9d8fefcdcfc01b9c94a29f2aa0b9c8dcb58ab32'
    const browser = process.env.BROWSER_BIN ?? 'google-chrome'
    const profile = await mkdtemp(join(tmpdir(), 'genui-mermaid-'))
    await mkdir(out, { recursive: true })
    const fixture = `
    import React from 'react'
    import { createRoot } from 'react-dom/client'
    import { flushSync } from 'react-dom'
    import { MermaidNode } from '/src/client/blocks/advanced.tsx'
    import { MermaidNode as BaselineNode } from '/src/client/blocks/advanced-baseline.tsx'
    import { assertSafeSvg } from '/src/client/mermaid-safe.ts'
    import { renderMermaid as renderCurrent } from '/src/client/mermaid-core.ts'
    import { renderMermaid as renderBaseline } from '/src/client/mermaid-core-baseline.ts'
    window.run = async (mode) => {
      const render = mode === 'baseline' ? renderBaseline : renderCurrent
      const calls = []
      const checks = []
      const check = (name, pass) => {
        checks.push({ name, pass })
        if (!pass) throw new Error(name)
      }
      window.__GenuiAssets__ = {
        mermaid: {
          renderMermaid: async (code, target) => {
            const start = performance.now()
            const svg = await render(code, target)
            assertSafeSvg(svg)
            calls.push({ ms: performance.now() - start, code })
            return svg
          },
        },
      }
      const hostStyle = document.createElement('style')
      hostStyle.textContent =
        'body {font-family: "Helvetica Neue", sans-serif; color: rgb(15,17,21); margin:0} body {--dsw-alias-label-primary:#0f1115;--dsw-alias-bg-layer-2:#eef0f4;--dsw-alias-border-l2:#a0a0a0;--dsw-alias-label-tertiary:#555555}'
      document.head.append(hostStyle)
      hostStyle.textContent +=
        'body[data-theme=dark],html[data-theme=dark] body {color:#f4f5f6;background:#12151a;--dsw-alias-label-primary:#f4f5f6;--dsw-alias-bg-layer-2:#22252b;--dsw-alias-border-l2:#89909a;--dsw-alias-label-tertiary:#aeb6c4}'
      // Synthetic long transcript + costly host cascade, identical in both runs.
      for (let sheet = 0; sheet < 196; sheet++) {
        const s = document.createElement('style')
        s.textContent = Array.from(
          { length: 100 },
          (_, j) =>
            '.transcript .message:nth-child(' +
            (j + 1) +
            ') .unused' +
            sheet +
            ' { color: inherit; }',
        ).join('')
        document.head.append(s)
      }
      const transcript = document.createElement('div')
      transcript.className = 'transcript'
      transcript.innerHTML = Array.from(
        { length: 5000 },
        (_, i) => '<span class="message">message ' + i + '</span>',
      ).join('')
      document.body.append(transcript)
      const source =
        'flowchart TD\\n' +
        Array.from(
          { length: 12 },
          (_, i) => 'N' + i + '["节点 ' + i + ' mixed label"] --> N' + (i + 1),
        ).join('\\n')
      // Evaluate the reporter's isolation idea in a separate realm. Mirrored
      // styles and CSSOM-assigned fonts are required for a fair fidelity check.
      const frame = document.createElement('iframe')
      frame.style.position = 'fixed'
      frame.style.left = '-100000px'
      frame.style.width = innerWidth + 'px'
      document.body.append(frame)
      const frameDoc = frame.contentDocument
      for (const style of document.querySelectorAll(
        'head style, head link[rel=stylesheet]',
      ))
        frameDoc.head.append(style.cloneNode(true))
      const hostComputed = getComputedStyle(document.body)
      frameDoc.body.style.fontFamily = hostComputed.fontFamily
      frameDoc.body.style.color = hostComputed.color
      for (const name of hostComputed)
        if (name.startsWith('--'))
          frameDoc.body.style.setProperty(name, hostComputed.getPropertyValue(name))
      const probe = (doc) => {
        const el = doc.createElement('span')
        el.textContent = '中文 mixed wide 标签'
        el.style.fontSize = '13px'
        doc.body.append(el)
        const value = {
          width: el.getBoundingClientRect().width,
          color: doc.defaultView.getComputedStyle(el).color,
          font: doc.defaultView.getComputedStyle(el).fontFamily,
        }
        el.remove()
        return value
      }
      const hostFont = probe(document),
        frameFont = probe(frameDoc)
      check(
        'isolation font width',
        Math.abs(hostFont.width - frameFont.width) / hostFont.width <= 0.004,
      )
      check('isolation text color', hostFont.color === frameFont.color)
      const isolated = await frame.contentWindow.eval(
        'import("/src/client/mermaid-core' + (mode === 'baseline' ? '-baseline' : '') + '.ts")',
      )
      await isolated.renderMermaid(source)
      await render(source)
      const isolation = []
      for (let i = 0; i < 3; i++) {
        let t = performance.now()
        const hostSvg = await render(source)
        const hostMs = performance.now() - t
        t = performance.now()
        const isolatedSvg = await isolated.renderMermaid(source)
        const isolatedMs = performance.now() - t
        const box = (svg) =>
          new DOMParser()
            .parseFromString(svg, 'image/svg+xml')
            .documentElement.getAttribute('viewBox')
        check('isolated geometry ' + i, box(hostSvg) === box(isolatedSvg))
        isolation.push({ hostMs, isolatedMs })
      }
      frame.remove()
      // Warm the same engine/parser before collecting scheduling metrics.
      await render('graph TD\\nA --> B')
      await new Promise((r) => setTimeout(r, 50))
      const longTasks = []
      const observer = new PerformanceObserver((list) =>
        longTasks.push(...list.getEntries().map((e) => e.duration)),
      )
      observer.observe({ type: 'longtask', buffered: false })
      let maxGap = 0,
        last = performance.now()
      const heartbeat = setInterval(() => {
        const now = performance.now()
        maxGap = Math.max(maxGap, now - last)
        last = now
      }, 10)
      const mount = document.createElement('div')
      document.body.prepend(mount)
      const app = createRoot(mount)
      const Node = mode === 'baseline' ? BaselineNode : MermaidNode
      const nodes = Array.from({ length: 9 }, (_, i) =>
        React.createElement(
          'section',
          { key: i, style: { minHeight: '900px' } },
          React.createElement(Node, {
            node: { type: 'mermaid', code: source + '\\n%% ' + i },
          }),
        ),
      )
      window.measureReady = true
      await new Promise((r) => (window.beginMeasurement = r))
      const start = performance.now()
      flushSync(() => app.render(nodes))
      const wait = async (predicate) => {
        const deadline = performance.now() + 60000
        while (!predicate()) {
          if (performance.now() > deadline)
            throw new Error('timed out: ' + calls.length + ' renders')
          await new Promise((r) => setTimeout(r, 25))
        }
      }
      // A selected baseline can already have viewport gating. Wait for visible
      // work rather than assuming every historical version starts all nine.
      await wait(() => calls.length >= 1)
      await new Promise((r) => setTimeout(r, 200))
      const initial = {
        renders: calls.length,
        promiseMs: calls.reduce((s, c) => s + c.ms, 0),
        elapsedMs: performance.now() - start,
        maxGap,
        longTasks: [...longTasks],
      }
      window.initialReady = true
      await new Promise((r) => (window.continueMeasurement = r))
      for (const section of mount.children) {
        section.scrollIntoView()
        await new Promise((r) => setTimeout(r, 300))
      }
      await wait(() => mount.querySelectorAll('[data-genui-mermaid]').length === 9)
      const svgs = [...mount.querySelectorAll('[data-genui-mermaid] svg')]
      // Actual source changes and history prepends through the production node.
      check('nine diagrams', svgs.length === 9)
      const originalBox = svgs[0].getAttribute('viewBox')
      for (const svg of svgs) assertSafeSvg(svg.outerHTML)
      check(
        'same geometry for repeated diagrams',
        svgs.every((s) => s.getAttribute('viewBox') === originalBox),
      )
      if (mode === 'current') {
        check('offscreen work deferred', initial.renders < 9)
        const before = calls.length
        document.body.setAttribute('data-theme', 'dark')
        const visibleDiagram = () =>
          mount.lastElementChild.querySelector('[data-genui-mermaid]')
        const hasColor = (svg, color) => {
          if (!svg) return false
          const colors = [...svg.querySelectorAll('text')]
            .filter(label => label.textContent.trim())
            .map(label => getComputedStyle(label).fill)
          for (const label of svg.querySelectorAll('foreignObject')) {
            const walker = document.createTreeWalker(label, NodeFilter.SHOW_TEXT)
            for (let text = walker.nextNode(); text; text = walker.nextNode()) {
              if (text.textContent.trim()) colors.push(getComputedStyle(text.parentElement).color)
            }
          }
          return colors.length > 0 && colors.every(actual => actual === color)
        }
        await wait(
          () =>
            calls.length > before &&
            hasColor(visibleDiagram(), 'rgb(244, 245, 246)'),
        )
        check(
          'theme colors refreshed',
          hasColor(visibleDiagram(), 'rgb(244, 245, 246)'),
        )
        const darkCount = calls.length
        document.body.removeAttribute('data-theme')
        document.documentElement.setAttribute('data-theme', 'light')
        await wait(
          () =>
            calls.length > darkCount &&
            hasColor(visibleDiagram(), 'rgb(15, 17, 21)'),
        )
        check('light theme restored', hasColor(visibleDiagram(), 'rgb(15, 17, 21)'))
        flushSync(() =>
          app.render(
            React.createElement(Node, {
              node: { type: 'mermaid', code: 'graph TD\\nX --> Y' },
            }),
          ),
        )
        flushSync(() =>
          app.render(
            React.createElement(Node, {
              node: { type: 'mermaid', code: 'graph TD\\nFinal --> Current' },
            }),
          ),
        )
        scrollTo(0, 0)
        await wait(() =>
          mount
            .querySelector('[data-genui-mermaid]')
            ?.textContent.includes('Current'),
        )
        check(
          'latest streaming source wins',
          !mount.textContent.includes('mixed label'),
        )
        flushSync(() =>
          app.render([
            React.createElement(Node, {
              key: 'history',
              node: {
                type: 'mermaid',
                code: 'sequenceDiagram\\nAlice->>Bob: history',
              },
            }),
            React.createElement(Node, {
              key: 'latest',
              node: { type: 'mermaid', code: 'graph TD\\nFinal --> Current' },
            }),
          ]),
        )
        await wait(
          () => mount.querySelectorAll('[data-genui-mermaid]').length === 2,
        )
        check(
          'history prepend renders both diagrams',
          mount.textContent.includes('history') &&
            mount.textContent.includes('Current'),
        )
      }
      if (mode === 'current') {
        // #328: layout and visible labels must use the same inherited card font.
        // Measuring against body then inheriting from monospace clips CJK suffixes.
        const card = document.createElement('div')
        Object.assign(card.style, { position: 'fixed', top: '0', left: '0', width: '1000px' })
        document.body.append(card)
        const fontApp = createRoot(card)
        try {
          for (const font of ['sans-serif', 'monospace', 'serif']) {
            card.style.fontFamily = font
            const before = calls.length
            flushSync(() => fontApp.render(React.createElement(Node, {
              node: { type: 'mermaid', code: 'flowchart LR\\nA["dsh-ui 围栏"] --> B["表格 / 图表"]' },
            })))
            await wait(() => calls.length > before && card.querySelector('[data-genui-mermaid] svg') !== null
              && getComputedStyle(card.querySelector('svg')).fontFamily === font)
            const labels = [...card.querySelectorAll('foreignObject')].filter(label => label.textContent.trim())
            check('CJK labels present in ' + font, labels.length === 2)
            for (const label of labels) {
              const range = document.createRange()
              range.selectNodeContents(label.querySelector('.nodeLabel') ?? label)
              check('CJK label fits in ' + font + ': ' + label.textContent,
                range.getBoundingClientRect().right <= label.getBoundingClientRect().right + 1)
            }
          }
        } finally { fontApp.unmount(); card.remove() }
      }
      const kinds = [
        'sequenceDiagram\\nAlice->>Bob: Hello',
        'classDiagram\\nAnimal <|-- Duck',
        'stateDiagram-v2\\n[*] --> Active',
        'gantt\\n dateFormat YYYY-MM-DD\\n section Work\\n Task :2026-01-01, 1d',
        'pie\\n"One" : 1',
        'erDiagram\\nPERSON ||--o{ PET : owns',
        'journey\\n title Day\\n section Work\\n Task: 5: Me',
        'gitGraph\\n commit',
      ]
      for (const code of kinds) {
        const svg = await render(code)
        assertSafeSvg(svg)
        check('kind ' + code.split('\\n')[0], svg.includes('<svg'))
      }
      let rejected = false
      try {
        await render('mindmap\\n root((unsupported))')
      } catch {
        rejected = true
      }
      check('kind allowlist', rejected)
      rejected = false
      try {
        await render('graph TD\\n[]')
      } catch {
        rejected = true
      }
      check('invalid source rejected', rejected)
      let attackSvg
      try {
        attackSvg = await render(
          'graph TD\\nA["safe"]\\nclick A "javascript:alert(1)"',
        )
      } catch {}
      if (attackSvg !== undefined) assertSafeSvg(attackSvg)
      check(
        'strict javascript-link handling',
        attackSvg === undefined || !/javascript:/i.test(attackSvg),
      )
      check(
        'label repair',
        (await render('graph TD\\nA[中文 标签] --> B')).includes('<svg'),
      )
      window.previewDark = async () => {
        const before = calls.length
        document.documentElement.setAttribute('data-theme', 'dark')
        await wait(
          () =>
            calls.length >= before + 2 &&
            mount.querySelectorAll('[data-genui-mermaid]').length === 2,
        )
      }
      const result = {
        mode,
        isolation,
        hostFont,
        frameFont,
        checks,
        initial,
        totalRenders: calls.length,
        diagrams: svgs.length,
        viewBoxes: svgs.map((s) => s.getAttribute('viewBox')),
        labels: svgs.map((s) =>
          [...s.querySelectorAll('text, foreignObject')].map(
            (label) => label.textContent,
          ),
        ),
        unsafe: mount.querySelector('script, [onload], [onclick]') !== null,
      }
      clearInterval(heartbeat)
      observer.disconnect()
      window.result = result
      return result
    }
    `
    let server, chrome, socket
    try {
      server = await createServer({
        root,
        configFile: false,
        server: {
          host: '127.0.0.1',
          port: 0,
          fs: { allow: [root, resolve(root, 'node_modules')] },
        },
        optimizeDeps: {
          include: [
            'mermaid',
            'react',
            'react-dom/client',
            'react-dom',
            'react/jsx-runtime',
            'react/jsx-dev-runtime',
          ],
        },
        resolve: {
          dedupe: ['react', 'react-dom'],
          alias: [
            {
              find: /^(?:.*\/)?primitive-adapter\.ts$/,
              replacement: resolve(
                root,
                'src/client/standalone/primitive-adapter.tsx',
              ),
            },
          ],
        },
        plugins: [
          {
            name: 'mermaid-regression-fixture',
            resolveId(id, importer) {
              if (id === '/mermaid-check.js') return id
              if (id.endsWith('-baseline.ts') || id.endsWith('-baseline.tsx'))
                return id.startsWith('.')
                  ? resolve(dirname(importer), id)
                  : resolve(root, id.replace(/^\//, ''))
            },
            load(id) {
              if (id === '/mermaid-check.js') return fixture
              if (!id.includes('-baseline.')) return
              const path = id.slice(root.length).replace('-baseline.', '.')
              return execFileSync('git', ['show', baseline + ':' + path], {
                cwd: root,
                encoding: 'utf8',
              }).replace(
                "import('../mermaid-lazy.ts')",
                "import('../mermaid-lazy-baseline.ts')",
              )
            },
            configureServer(s) {
              s.middlewares.use((req, res, next) => {
                if (req.url === '/mermaid-check') {
                  res.setHeader('Content-Type', 'text/html')
                  res.end(
                    '<!doctype html><html><head></head><body><script type="module" src="/mermaid-check.js"></script></body></html>',
                  )
                } else next()
              })
            },
          },
        ],
      })
      await server.listen()
      const port = server.httpServer.address().port
      chrome = spawn(
        browser,
        [
          '--headless',
          '--password-store=basic',
          '--use-mock-keychain',
          '--no-sandbox',
          '--disable-gpu',
          '--no-first-run',
          '--disable-extensions',
          '--disable-background-networking',
          '--remote-debugging-port=0',
          `--user-data-dir=${profile}`,
          '--window-size=1200,800',
          'about:blank',
        ],
        { stdio: ['ignore', 'ignore', 'pipe'] },
      )
      const endpoint = await new Promise((ok, no) => {
        let log = ''
        const timeout = setTimeout(
          () => no(new Error('Chrome startup timeout: ' + log)),
          20000,
        )
        chrome.once('error', no)
        chrome.stderr.on('data', (data) => {
          log += data
          const match = /DevTools listening on (ws:\/\/\S+)/.exec(log)
          if (match) {
            clearTimeout(timeout)
            ok(match[1])
          }
        })
      })
      socket = new WebSocket(endpoint)
      await new Promise((ok, no) => {
        socket.onopen = ok
        socket.onerror = no
      })
      let seq = 0
      const pending = new Map()
      socket.onmessage = (event) => {
        const msg = JSON.parse(event.data)
        if (msg.id) {
          const p = pending.get(msg.id)
          pending.delete(msg.id)
          msg.error
            ? p.reject(new Error(JSON.stringify(msg.error)))
            : p.resolve(msg.result)
        }
      }
      const send = (method, params = {}, sessionId) =>
        new Promise((resolve, reject) => {
          const id = ++seq
          pending.set(id, { resolve, reject })
          socket.send(JSON.stringify({ id, method, params, sessionId }))
        })
      const results = []
      const poll = async (sessionId, expression) => {
        for (let i = 0; i < 1200; i++) {
          const r = await send(
            'Runtime.evaluate',
            { expression, returnByValue: true },
            sessionId,
          )
          if (r.result.value) {
            if (typeof r.result.value === 'string') throw new Error(r.result.value)
            return r.result.value
          }
          await new Promise((r) => setTimeout(r, 50))
        }
        throw new Error('Browser wait timed out: ' + expression)
      }
      for (const mode of ['baseline', 'current']) {
        const { targetId } = await send('Target.createTarget', {
          url: 'about:blank',
        })
        const { sessionId } = await send('Target.attachToTarget', {
          targetId,
          flatten: true,
        })
        await send('Page.enable', {}, sessionId)
        await send(
          'Page.navigate',
          { url: `http://127.0.0.1:${port}/mermaid-check` },
          sessionId,
        )
        for (let i = 0; i < 600; i++) {
          const ready = await send(
            'Runtime.evaluate',
            { expression: 'typeof window.run === "function"' },
            sessionId,
          )
          if (ready.result.value) break
          await new Promise((r) => setTimeout(r, 100))
          if (i === 599) throw new Error('Fixture did not load')
        }
        await send('Emulation.setCPUThrottlingRate', { rate: 4 }, sessionId)
        await send('Performance.enable', {}, sessionId)
        await send(
          'Runtime.evaluate',
          {
            expression: `window.runPromise=window.run(${JSON.stringify(mode)}).catch(e=>{window.failure=e.stack;throw e});undefined`,
          },
          sessionId,
        )
        await poll(sessionId, 'window.measureReady || window.failure')
        const before = await send('Performance.getMetrics', {}, sessionId)
        await send(
          'Runtime.evaluate',
          { expression: 'window.beginMeasurement()' },
          sessionId,
        )
        await poll(sessionId, 'window.initialReady || window.failure')
        const after = await send('Performance.getMetrics', {}, sessionId)
        await send(
          'Runtime.evaluate',
          { expression: 'window.continueMeasurement()' },
          sessionId,
        )
        const response = await send(
          'Runtime.evaluate',
          {
            expression: 'window.runPromise',
            awaitPromise: true,
            returnByValue: true,
          },
          sessionId,
        )
        if (response.result?.value) {
          response.result.value.initial.cpu = {}
          for (const name of [
            'TaskDuration',
            'ScriptDuration',
            'LayoutDuration',
            'RecalcStyleDuration',
          ]) {
            const value = (ms) =>
              ms.metrics.find((m) => m.name === name)?.value ?? 0
            response.result.value.initial.cpu[name + 'Ms'] =
              (value(after) - value(before)) * 1000
          }
        }
        if (response.exceptionDetails)
          throw new Error(JSON.stringify(response.exceptionDetails))
        results.push(response.result.value)
        const shot = await send(
          'Page.captureScreenshot',
          { format: 'png' },
          sessionId,
        )
        await writeFile(join(out, mode + '.png'), Buffer.from(shot.data, 'base64'))
        if (mode === 'current') {
          await send(
            'Runtime.evaluate',
            { expression: 'window.previewDark()', awaitPromise: true },
            sessionId,
          )
          const dark = await send(
            'Page.captureScreenshot',
            { format: 'png' },
            sessionId,
          )
          await writeFile(
            join(out, 'current-dark.png'),
            Buffer.from(dark.data, 'base64'),
          )
        }
        await send('Target.closeTarget', { targetId })
      }
      await writeFile(
        join(out, 'results.json'),
        JSON.stringify({ baseline, results }, null, 2) + '\n',
      )
      for (const r of results)
        console.log(
          JSON.stringify(
            { ...r, labels: undefined, viewBoxes: [...new Set(r.viewBoxes)] },
            null,
            2,
          ),
        )
      // Font measurement fixes can legitimately change layout dimensions. The
      // labels must stay identical, and current CJK geometry is checked above.
      if (JSON.stringify(results[0].labels) !== JSON.stringify(results[1].labels))
        throw new Error('Baseline/current label mismatch')
      if (results.some((r) => r.diagrams !== 9 || r.unsafe))
        throw new Error('Diagram count/security regression')
    } finally {
      socket?.close()
      chrome?.kill()
      await server?.close()
      await rm(profile, {
        recursive: true,
        force: true,
        maxRetries: 5,
        retryDelay: 200,
      })
    }
    
  • scripts/check-standalone.mjs1.1 KB722838c17a8eupstream ↗
    import { readFile, stat } from 'node:fs/promises'
    
    const bundlePath = new URL('../lib/assets/standalone-runtime.js', import.meta.url)
    await stat(bundlePath)
    const bundle = await readFile(bundlePath, 'utf8')
    const required = ['genuiStandaloneKatex', 'data:font/woff2;base64,', '__GenuiStandalone__']
    const missing = required.filter(value => !bundle.includes(value))
    if (missing.length > 0) throw new Error(`standalone runtime is missing required content: ${missing.join(', ')}`)
    const fontFallbacks = ['data:font/woff;base64,', 'data:font/ttf;base64,']
    const embeddedFallbacks = fontFallbacks.filter(value => bundle.includes(value))
    if (embeddedFallbacks.length > 0) throw new Error(`standalone runtime contains redundant font formats: ${embeddedFallbacks.join(', ')}`)
    const forbidden = [
      'window.__ModuleLoader__',
      '/plugins/@changfenhuang/dsh-genui',
      'conversation.send',
      '@deepseek-ai/dsh-client-ui-primitives',
    ]
    const found = forbidden.filter(value => bundle.includes(value))
    if (found.length > 0) throw new Error(`standalone runtime contains forbidden host references: ${found.join(', ')}`)
    console.log('standalone runtime bundle check passed')
    
  • scripts/check-steps-marker-browser.mjs9.4 KB1d612f91f1c1upstream ↗
    #!/usr/bin/env node
    /** #410: inherited body line height must not displace fixed-size step markers.
     * Reuses the Chromium/CDP and Vite fixture approach of check-blocks-theme-browser.
     * GENUI_STEPS_CSS substitutes only the source stylesheet for a baseline run.
     */
    import assert from 'node:assert/strict'
    import { spawn } from 'node:child_process'
    import { mkdir, mkdtemp, readFile, rm, writeFile } from 'node:fs/promises'
    import { tmpdir } from 'node:os'
    import { dirname, join, resolve } from 'node:path'
    import { fileURLToPath } from 'node:url'
    import { createServer } from 'vite'
    import { JSDOM } from 'jsdom'
    
    const root = resolve(dirname(fileURLToPath(import.meta.url)), '..')
    const out = resolve(process.env.GENUI_BROWSER_OUT ?? join(root, '.e2e-artifacts/steps-marker'))
    const browser = process.env.BROWSER_BIN ?? 'chromium'
    const hostCss = process.env.GENUI_HOST_THEME_CSS ? await readFile(process.env.GENUI_HOST_THEME_CSS, 'utf8') : null
    const failures = []
    const check = (condition, message) => { if (!condition) failures.push(message) }
    const pause = ms => new Promise(resolve => setTimeout(resolve, ms))
    
    /** CDP waits for the fixture rather than Chromium's dump-dom load heuristic.
     * Vite modules (and optional host tokens) finish asynchronously after load. */
    async function render(url, screenshot, width) {
      const profile = await mkdtemp(join(tmpdir(), 'genui-blocks-chrome-'))
      const process = spawn(browser, [
        '--headless=new', '--no-sandbox', '--disable-dev-shm-usage', '--disable-gpu',
        '--disable-background-networking', '--disable-extensions', '--disable-sync', '--no-first-run',
        `--user-data-dir=${profile}`, '--remote-debugging-port=0', 'about:blank',
      ], { stdio: ['ignore', 'ignore', 'pipe'] })
      let stderr = ''
      process.stderr.on('data', chunk => { stderr += chunk })
      let socket
      try {
        let port
        for (let i = 0; i < 100; i++) {
          try { port = (await readFile(join(profile, 'DevToolsActivePort'), 'utf8')).split('\n')[0]; break } catch { await pause(100) }
        }
        assert.ok(port, `Chromium CDP did not start: ${stderr}`)
        const targets = await (await fetch(`http://127.0.0.1:${port}/json/list`)).json()
        socket = new WebSocket(targets.find(target => target.type === 'page').webSocketDebuggerUrl)
        await new Promise((resolve, reject) => { socket.onopen = resolve; socket.onerror = reject })
        let next = 0
        const pending = new Map()
        socket.onmessage = event => {
          const message = JSON.parse(event.data)
          if (message.id) pending.get(message.id)?.(message)
        }
        const command = (method, params = {}) => new Promise((resolve, reject) => {
          const id = ++next
          const timer = setTimeout(() => { pending.delete(id); reject(new Error(`CDP timeout: ${method}`)) }, 10000)
          pending.set(id, message => {
            clearTimeout(timer)
            pending.delete(id)
            if (message.error) reject(new Error(JSON.stringify(message.error)))
            else resolve(message.result)
          })
          socket.send(JSON.stringify({ id, method, params }))
        })
        const evaluate = async expression => (await command('Runtime.evaluate', { expression, returnByValue: true })).result.value
        await command('Emulation.setDeviceMetricsOverride', { width, height: 1300, deviceScaleFactor: 1, mobile: false })
        await command('Page.navigate', { url })
        let ready = false
        for (let i = 0; i < 150; i++) {
          ready = await evaluate("Boolean(document.getElementById('results') && document.getElementById('results').textContent !== 'pending')")
          if (ready) break
          const error = await evaluate("document.getElementById('browser-errors')?.textContent")
          assert.ok(!error, `Browser fixture error: ${error}`)
          await pause(100)
        }
        assert.ok(ready, `Browser fixture did not finish: ${stderr}`)
        await command('Runtime.evaluate', { expression: 'document.fonts.ready', awaitPromise: true })
        await command('Runtime.evaluate', {
          expression: 'Promise.all(document.getAnimations().filter(a => Number.isFinite(a.effect.getComputedTiming().endTime)).map(a => a.finished.catch(() => {})))',
          awaitPromise: true,
        })
        const { cssContentSize } = await command('Page.getLayoutMetrics')
        const shot = await command('Page.captureScreenshot', {
          captureBeyondViewport: true,
          clip: { x: 0, y: 0, width, height: cssContentSize.height, scale: 1 },
        })
        await writeFile(screenshot, Buffer.from(shot.data, 'base64'))
        const region = await evaluate(`(() => {
          const box = document.querySelector('[data-font="20"][data-line-height="2.1"]').getBoundingClientRect()
          return { x: box.x + scrollX, y: box.y + scrollY, width: box.width, height: box.height, scale: 1 }
        })()`)
        const detail = await command('Page.captureScreenshot', { captureBeyondViewport: true, clip: region })
        await writeFile(screenshot.replace(/\.png$/, '-20px.png'), Buffer.from(detail.data, 'base64'))
        return { stdout: await evaluate('document.documentElement.outerHTML'), stderr }
      } finally {
        socket?.close()
        process.kill('SIGTERM')
        for (let i = 0; i < 30 && process.exitCode === null; i++) await pause(100)
        if (process.exitCode === null) process.kill('SIGKILL')
        await rm(profile, { recursive: true, force: true })
      }
    }
    const server = await createServer({
      root, configFile: false,
      plugins: [{ name: 'steps-marker-fixture', enforce: 'pre', async load(id) {
        if (process.env.GENUI_STEPS_CSS && id === resolve(root, 'src/client/GenuiBlock.module.css')) {
          return await readFile(process.env.GENUI_STEPS_CSS, 'utf8')
        }
      }, configureServer(server) {
        server.middlewares.use('/__host-theme.css', (_req, res) => {
          res.statusCode = hostCss === null ? 404 : 200
          res.setHeader('Content-Type', 'text/css')
          res.end(hostCss ?? '')
        })
      } }],
      server: { host: '127.0.0.1', port: 0, strictPort: true, watch: { ignored: ['**/.e2e-artifacts/**'] } },
      resolve: {
        dedupe: ['react', 'react-dom'],
        alias: [{ find: /^(?:.*\/)?primitive-adapter\.ts$/, replacement: resolve(root, 'src/client/standalone/primitive-adapter.tsx') }],
      },
      optimizeDeps: { entries: ['tests/browser/steps-marker.html'], include: ['react', 'react/jsx-runtime', 'react/jsx-dev-runtime', 'react-dom', 'react-dom/client', 'katex'] },
    })
    await mkdir(out, { recursive: true })
    let checked = 0
    try {
      await server.listen()
      const address = server.httpServer.address()
      assert.ok(address && typeof address !== 'string')
      for (const palette of hostCss === null ? ['export'] : ['host', 'export']) {
        for (const theme of ['light', 'dark']) {
          for (const width of [390, 1100]) {
            const name = `${palette}-${theme}-${width}`
            const { stdout, stderr } = await render(
              `http://127.0.0.1:${address.port}/tests/browser/steps-marker.html?theme=${theme}&palette=${palette}`,
              join(out, `${name}.png`), width,
            )
            const document = new JSDOM(stdout).window.document
            assert.equal(document.getElementById('browser-errors')?.textContent, '', `${name}: browser errors`)
            const results = JSON.parse(document.getElementById('results').textContent)
            await writeFile(join(out, `${name}.json`), JSON.stringify(results, null, 2) + '\n')
            await writeFile(join(out, `${name}.log`), stderr)
            assert.equal(results.samples.length, 48, `${name}: real renderer marker count`)
            check(!results.overflow, `${name}: horizontal overflow`)
            if (width === 390) check(results.samples.some(sample => sample.hostFont === 20 && sample.titleLines > 1.5), `${name}: narrow case must exercise title wrapping`)
            for (const sample of results.samples) {
              const label = `${name}/${sample.hostFont}/${sample.hostLineHeight}/${sample.state}/${sample.text}`
              check(Math.abs(sample.width - 24) < 0.01 && Math.abs(sample.height - 24) < 0.01, `${label}: marker size changed`)
              // The marker's own line box must fit and remain independent of body leading.
              check(Math.abs(sample.lineHeight - sample.font) < 0.02, `${label}: inherited line-height ${sample.lineHeight}px`)
              // Range includes font ascent/descent, not just visible ink. Some
              // fallback fonts use all 24px; require containment and centering,
              // rather than pretending this measures raster glyph padding.
              check(sample.textTop >= 0 && sample.textBottom <= 24, `${label}: text range escapes marker`)
              check(Math.abs(sample.textCenterOffset) <= 1.5, `${label}: text range is off center`)
              check(sample.titleClear, `${label}: marker/title overlap or clipped title`)
              // Only marker leading changes; readable title/description leading stays intact.
              check(Math.abs(sample.titleLineHeight / Math.max(14.5, sample.hostFont * 0.852941176) - 1.45) < 0.01, `${label}: title leading changed`)
              check(Math.abs(sample.descLineHeight / Math.max(12.5, sample.hostFont * 0.735294118) - 1.55) < 0.01, `${label}: description leading changed`)
              const peer = results.samples.find(other => other.hostFont === sample.hostFont && other.state === sample.state && other.text === sample.text && other.hostLineHeight !== sample.hostLineHeight)
              check(Math.abs(sample.textCenterOffset - peer.textCenterOffset) < 0.05, `${label}: body leading moves text`)
            }
            checked += results.samples.length
            console.log(`${name}: measured ${results.samples.length} markers`)
          }
        }
      }
      assert.deepEqual(failures, [], 'Step marker browser regression')
      console.log(`Chromium step marker check passed: ${checked} markers`)
    } finally { await server.close() }
    
  • scripts/check-table-wrap-browser.mjs8.8 KB6662900ae564upstream ↗
    #!/usr/bin/env node
    /** Actual Chromium layout regression for #382 (`table.wrap`); synthetic data only.
     * Uses the runner's installed Chrome (or BROWSER_BIN), Vite, and the standalone
     * primitive adapter. No DSH instance, model calls, credentials, or new deps.
     * Run: BROWSER_BIN=/usr/bin/google-chrome node scripts/check-table-wrap-browser.mjs
     *
     * The two contracts this pins down:
     *   1. the default data-table voice (#326) is UNCHANGED — nowrap cells, a table
     *      sized to max-content, and horizontal scrolling when it outgrows the
     *      message column;
     *   2. `wrap: true` tracks the container, wraps the cells, and gives every
     *      column a readable floor — i.e. it must not reproduce #326's
     *      column-collapse bug (a short column squeezed to one glyph per line).
     */
    import { execFile } from 'node:child_process'
    import { mkdtemp, mkdir, readFile, rm, writeFile } from 'node:fs/promises'
    import { tmpdir } from 'node:os'
    import { dirname, join, resolve } from 'node:path'
    import { fileURLToPath } from 'node:url'
    import { promisify } from 'node:util'
    import { createServer } from 'vite'
    
    const exec = promisify(execFile)
    const root = resolve(dirname(fileURLToPath(import.meta.url)), '..')
    const out = resolve(root, '.e2e-artifacts/table-wrap')
    let profile
    let server
    try {
      await mkdir(out, { recursive: true })
      // Keep the browser profile OUTSIDE the project: Vite watches the repo root,
      // and on Windows Chrome holds a lock on its own Cookies file — watching it
      // aborts the server with EBUSY before the fixture can load.
      profile = await mkdtemp(join(tmpdir(), 'genui-table-wrap-chrome-'))
      const candidates = process.env.BROWSER_BIN
        ? [process.env.BROWSER_BIN]
        : [
          'google-chrome',
          'chromium',
          'chromium-browser',
          // Windows runners/users: the browser is normally Edge.
          'msedge',
          'C:\\Program Files (x86)\\Microsoft\\Edge\\Application\\msedge.exe',
          'C:\\Program Files\\Microsoft\\Edge\\Application\\msedge.exe',
        ]
      let browser
      for (const candidate of candidates) {
        try { await exec(candidate, ['--version']); browser = candidate; break } catch { /* try another installed browser */ }
      }
      if (browser === undefined) throw new Error('Install Chrome/Chromium or set BROWSER_BIN to an installed browser executable')
      server = await createServer({
        root, configFile: false,
        server: { host: '127.0.0.1', port: 0, strictPort: true, watch: { ignored: ['**/.e2e-artifacts/**'] } },
        resolve: {
          dedupe: ['react', 'react-dom'],
          alias: [
            { find: /^(?:.*\/)?primitive-adapter\.ts$/, replacement: resolve(root, 'src/client/standalone/primitive-adapter.tsx') },
          ],
        },
        optimizeDeps: {
          include: ['react', 'react/jsx-runtime', 'react/jsx-dev-runtime', 'react-dom', 'react-dom/client'],
          force: true,
        },
      })
      await server.listen()
      const address = server.httpServer.address()
      if (address === null || typeof address === 'string') throw new Error('Vite did not bind a loopback TCP port')
      const { stdout, stderr } = await exec(browser, [
        '--headless=new', '--no-sandbox', '--disable-dev-shm-usage', '--disable-gpu',
        '--no-first-run', '--no-default-browser-check', '--disable-background-networking',
        '--disable-extensions', '--disable-sync', `--user-data-dir=${profile}`,
        '--virtual-time-budget=5000', '--window-size=1200,1800',
        `--screenshot=${join(out, 'layout.png')}`, '--dump-dom',
        `http://127.0.0.1:${address.port}/tests/browser/table-wrap.html`,
      ], { timeout: 30000, maxBuffer: 4 * 1024 * 1024 })
      await writeFile(join(out, 'page.html'), stdout)
      await writeFile(join(out, 'browser.log'), stderr)
      const raw = /<pre id="results">([^<]*)<\/pre>/.exec(stdout)?.[1]
      const browserErrors = /<pre id="browser-errors">([\s\S]*?)<\/pre>/.exec(stdout)?.[1]
      /** 解码 Chromium dump-dom 输出的 HTML 文本。 */
      const decodeBrowserText = value => value
        .replaceAll('&quot;', '"')
        .replaceAll('&#39;', "'")
        .replaceAll('&lt;', '<')
        .replaceAll('&gt;', '>')
        .replaceAll('&amp;', '&')
      const errorSummary = browserErrors === undefined ? '' : decodeBrowserText(browserErrors).trim().slice(0, 2000)
      if (raw === undefined || raw === 'pending') {
        const detail = errorSummary === '' ? 'inspect page.html and browser.log' : `Browser errors:\n${errorSummary}`
        throw new Error(`Browser fixture did not finish; ${detail}`)
      }
      if (errorSummary !== '') throw new Error(`Browser reported client errors:\n${errorSummary}`)
      const results = JSON.parse(decodeBrowserText(raw))
      await writeFile(join(out, 'results.json'), JSON.stringify(results, null, 2) + '\n')
    
      if (results.length !== 9) throw new Error(`Expected 9 browser layout checks, got ${results.length}`)
      const byName = Object.fromEntries(results.map(result => [result.name, result]))
      const failures = []
      /** 记录一条失败的断言,保留完整测量结果方便对照。 */
      const check = (condition, message) => { if (!condition) failures.push(message) }
    
      const dataDefault = byName['issue326 data table, default']
      const dataWrap = byName['issue326 data table, wrap']
      const proseDefault = byName['prose table, default']
      const proseWrap = byName['prose table, wrap']
      for (const [label, result] of Object.entries({ dataDefault, dataWrap, proseDefault, proseWrap })) {
        if (result === undefined) failures.push(`missing case: ${label}`)
      }
    
      if (dataDefault && dataWrap && proseDefault && proseWrap) {
        // 1. Default data table keeps #326's contract exactly.
        check(dataDefault.cellWhiteSpace === 'nowrap', `default data table cells must stay nowrap (got ${dataDefault.cellWhiteSpace})`)
        check(dataDefault.tableWidth > dataDefault.wrapWidth, `default data table must size to max-content and exceed the column (table ${dataDefault.tableWidth}px, column ${dataDefault.wrapWidth}px)`)
        check(dataDefault.overflows, 'default data table must scroll horizontally, not clip (#326)')
    
        // 2. wrap data table tracks the container and stays readable.
        check(dataWrap.cellWhiteSpace === 'normal', `wrap data table cells must wrap (got ${dataWrap.cellWhiteSpace})`)
        check(dataWrap.tableLayout === 'auto', `wrap data table must keep table-layout:auto (got ${dataWrap.tableLayout})`)
        check(!dataWrap.overflows, `wrap data table must fit its column (table ${dataWrap.tableWidth}px, column ${dataWrap.wrapWidth}px)`)
        check(dataWrap.minColWidth >= 80, `wrap data table column floor missing: min column ${dataWrap.minColWidth}px — #326 collapse risk`)
    
        // 3. Default prose table still overflows (so the wrap case below proves the switch works).
        check(proseDefault.cellWhiteSpace === 'nowrap', `default prose table cells must stay nowrap (got ${proseDefault.cellWhiteSpace})`)
        check(proseDefault.overflows, `default prose table must overflow at this column width (table ${proseDefault.tableWidth}px, column ${proseDefault.wrapWidth}px)`)
    
        // 4. wrap prose table fits, wraps, and keeps the column floor.
        check(proseWrap.cellWhiteSpace === 'normal', `wrap prose table cells must wrap (got ${proseWrap.cellWhiteSpace})`)
        check(!proseWrap.overflows, `wrap prose table must fit its column (table ${proseWrap.tableWidth}px, column ${proseWrap.wrapWidth}px)`)
        check(proseWrap.minColWidth >= 80, `wrap prose table column floor missing: min column ${proseWrap.minColWidth}px — #326 collapse risk`)
        check(proseWrap.rowHeight > proseDefault.rowHeight, `wrap prose table must actually wrap (row ${proseWrap.rowHeight}px vs ${proseDefault.rowHeight}px unwrapped)`)
      }
    
      for (const name of ['long token, wrap', 'inline code, wrap']) {
        const result = byName[name]
        check(result !== undefined && !result.overflows, `${name} must fit its 400px container`)
      }
      check(byName['inline code, wrap']?.codeWhiteSpace === 'pre-wrap', 'wrapped code must preserve spaces while wrapping')
      const multiline = byName['explicit newlines, wrap']
      check(multiline?.cellWhiteSpaces.join(',') === 'pre-line,pre-wrap', 'explicit prose and code newlines must keep their whitespace rules')
      check(multiline?.cellText[1] === 'print(1)\n    print(2)', 'copyable code indentation and newlines must survive')
      const narrow = byName['narrow six columns, wrap']
      check(narrow?.overflows && narrow.minColWidth >= 80, 'a narrow six-column table must scroll with readable columns')
      check(byName['nested default table']?.cellWhiteSpace === 'nowrap', 'parent wrapping must not change a nested default table')
    
      if (failures.length > 0) {
        throw new Error(`Browser table.wrap regression failed:\n${failures.map(line => `- ${line}`).join('\n')}\n\nmeasurements:\n${JSON.stringify(results, null, 2)}`)
      }
      await readFile(join(out, 'layout.png'))
      console.log(`Chromium table.wrap layout check passed: ${results.length} cases`)
    } finally {
      await server?.close()
      if (profile !== undefined) await rm(profile, { recursive: true, force: true })
    }
    
  • scripts/check-text-newlines-browser.mjs4.1 KBb6f8b4920f30upstream ↗
    #!/usr/bin/env node
    /** Actual Chromium layout/selection regression for #249; synthetic data only.
     * Uses the runner's installed Chrome (or BROWSER_BIN), Vite, and the standalone
     * primitive adapter. No DSH instance, model calls, credentials, or new deps.
     * Run: BROWSER_BIN=/usr/bin/google-chrome node scripts/check-text-newlines-browser.mjs
     */
    import { execFile } from 'node:child_process'
    import { mkdtemp, mkdir, readFile, rm, writeFile } from 'node:fs/promises'
    import { dirname, join, resolve } from 'node:path'
    import { fileURLToPath } from 'node:url'
    import { promisify } from 'node:util'
    import { createServer } from 'vite'
    
    const exec = promisify(execFile)
    const root = resolve(dirname(fileURLToPath(import.meta.url)), '..')
    const out = resolve(root, '.e2e-artifacts/text-newlines')
    let profile
    let server
    try {
      await mkdir(out, { recursive: true })
      profile = await mkdtemp(join(out, 'chrome-profile-'))
      const candidates = process.env.BROWSER_BIN ? [process.env.BROWSER_BIN] : ['google-chrome', 'chromium', 'chromium-browser']
      let browser
      for (const candidate of candidates) {
        try { await exec(candidate, ['--version']); browser = candidate; break } catch { /* try another installed browser */ }
      }
      if (browser === undefined) throw new Error('Install Chrome/Chromium or set BROWSER_BIN to an installed browser executable')
      server = await createServer({
        root, configFile: false,
        server: { host: '127.0.0.1', port: 0, strictPort: true },
        resolve: {
          dedupe: ['react', 'react-dom'],
          alias: [
            { find: /^(?:.*\/)?primitive-adapter\.ts$/, replacement: resolve(root, 'src/client/standalone/primitive-adapter.tsx') },
          ],
        },
        optimizeDeps: {
          include: ['react', 'react/jsx-runtime', 'react/jsx-dev-runtime', 'react-dom', 'react-dom/client'],
          force: true,
        },
      })
      await server.listen()
      const address = server.httpServer.address()
      if (address === null || typeof address === 'string') throw new Error('Vite did not bind a loopback TCP port')
      const { stdout, stderr } = await exec(browser, [
        '--headless', '--no-sandbox', '--disable-dev-shm-usage', '--disable-gpu',
        '--no-first-run', '--no-default-browser-check', '--disable-background-networking',
        '--disable-extensions', '--disable-sync', `--user-data-dir=${profile}`,
        '--virtual-time-budget=5000', '--window-size=1500,1800',
        `--screenshot=${join(out, 'layout.png')}`, '--dump-dom',
        `http://127.0.0.1:${address.port}/tests/browser/text-newlines.html`,
      ], { timeout: 30000, maxBuffer: 4 * 1024 * 1024 })
      await writeFile(join(out, 'page.html'), stdout)
      await writeFile(join(out, 'browser.log'), stderr)
      const raw = /<pre id="results">([^<]*)<\/pre>/.exec(stdout)?.[1]
      const browserErrors = /<pre id="browser-errors">([\s\S]*?)<\/pre>/.exec(stdout)?.[1]
      /** 解码 Chromium dump-dom 输出的 HTML 文本。 */
      const decodeBrowserText = value => value
        .replaceAll('&quot;', '"')
        .replaceAll('&#39;', "'")
        .replaceAll('&lt;', '<')
        .replaceAll('&gt;', '>')
        .replaceAll('&amp;', '&')
      const errorSummary = browserErrors === undefined ? '' : decodeBrowserText(browserErrors).trim().slice(0, 2000)
      if (raw === undefined || raw === 'pending') {
        const detail = errorSummary === '' ? 'inspect page.html and browser.log' : `Browser errors:\n${errorSummary}`
        throw new Error(`Browser fixture did not finish; ${detail}`)
      }
      if (errorSummary !== '') throw new Error(`Browser reported client errors:\n${errorSummary}`)
      const results = JSON.parse(decodeBrowserText(raw))
      await writeFile(join(out, 'results.json'), JSON.stringify(results, null, 2) + '\n')
      if (results.length !== 140) throw new Error(`Expected 140 browser layout checks, got ${results.length}`)
      const failed = results.filter(result => !result.pass)
      if (failed.length > 0) throw new Error(`Browser text layout regression failed:\n${JSON.stringify(failed, null, 2)}`)
      await readFile(join(out, 'layout.png'))
      console.log(`Chromium text layout/selection check passed: ${results.length} checks`)
    } finally {
      await server?.close()
      if (profile !== undefined) await rm(profile, { recursive: true, force: true })
    }
    
  • scripts/clean.mjs611 B2ad21583468dupstream ↗
    #!/usr/bin/env node
    /**
     * Cross-platform `lib` cleanup for the `build` / `check` scripts.
     *
     * The scripts used to spell this `rm -rf lib`. npm and pnpm run package
     * scripts through `cmd.exe` on Windows, where `rm` is not a command, so the
     * step failed (exit 1) and took the rest of the `&&` chain with it — most
     * visibly inside `prepack`, which spawns `cmd.exe /d /s /c "pnpm run build"`
     * on Windows on purpose. Doing the removal in Node keeps one command that
     * resolves in every shell the repo is built from.
     */
    import { rmSync } from 'node:fs'
    
    rmSync('lib', { recursive: true, force: true })
    
  • scripts/computed-browser-checks.mjs8.4 KBd559c980e00bupstream ↗
    /** 验收已安装的渲染器、真实会话和导出的独立运行页面。 */
    import assert from 'node:assert/strict'
    import { readFile, writeFile } from 'node:fs/promises'
    import { join } from 'node:path'
    import { pathToFileURL } from 'node:url'
    
    export const computedSpec = {
      title: 'Computed acceptance', computed: [{ id: 'total', expr: 'amount*2' }], items: [
        { type: 'tabs', tabs: [
          { label: 'Private', items: [{ type: 'input', id: 'secret', inputType: 'password', label: 'Private field' }] },
          { label: 'Public', items: [{ type: 'input', id: 'note', label: 'Public field' }] },
        ] },
        { type: 'accordion', items: [{ title: 'Amount section', items: [{ type: 'input', id: 'amount', inputType: 'number', label: 'Amount', value: '2' }] }] },
        { type: 'text', content: 'Result {{total}}' },
        { type: 'checkbox', group: 'choices', label: 'Choose {{total}}' },
        { type: 'echart', preset: 'heatmap', height: 180, series: [{ label: 'S', data: [{ label: 'Zero', value: 0 }, { label: 'Computed', value: { $computed: 'total' } }] }] },
        { type: 'submit', label: 'Send computed', action: 'computed-submit', groups: ['note', 'amount', 'choices'] },
      ],
    }
    export const panelBase = { panel: true, title: 'Computed panel acceptance',
      computed: [{ id: 'base', expr: 'panelAmount*2' }], items: [{ type: 'input', id: 'panelAmount', inputType: 'number', label: 'Panel amount', value: '3' }],
    }
    export const panelAppend = { panel: true, append: true,
      computed: [{ id: 'answer', expr: 'base+1' }], items: [{ type: 'text', content: 'Panel answer {{answer}}' }],
    }
    /** 在追加面板内容之前修改并收起输入字段。 */
    export async function editPanelBeforeAppend(page) {
      const panel = page.locator('[data-genui-panel]')
      await panel.waitFor({ state: 'visible' })
      await panel.locator('button[aria-expanded="false"]').first().click()
      await panel.getByLabel('Panel amount', { exact: true }).fill('5')
      await panel.locator('button[aria-expanded="true"]').first().click()
    }
    /** 确认面板追加后仍保留输入值并显示计算结果。 */
    export async function checkPanelAfterAppend(page) {
      const panel = page.locator('[data-genui-panel]')
      await panel.locator('button[aria-expanded="false"]').first().click()
      assert.equal(await panel.getByLabel('Panel amount', { exact: true }).inputValue(), '5')
      await panel.getByText('Panel answer 11', { exact: true }).waitFor({ state: 'visible' })
      await panel.locator('button[aria-expanded="true"]').first().click()
    }
    
    /** 验收宿主会话、组件导出和独立页面中的计算字段。 */
    export async function runComputedBrowserChecks({ page, browser, artifactsDir, verifySubmit }) {
      const report = { fixture: 'Official rc.3 replay conversation; installed tarball and exported HTML', passed: false }
      let standalone
      try {
        let root = page.locator('[data-chat-flow-kind="assistant-step"] [data-genui-artifact]').filter({ has: page.getByText('Computed acceptance', { exact: true }) })
        await root.getByLabel('Private field', { exact: true }).fill('SYNTHETIC_SECRET_TEST_ONLY')
        await root.getByRole('tab', { name: 'Public', exact: true }).click()
        assert.equal(await root.getByLabel('Public field', { exact: true }).inputValue(), '')
        await root.getByLabel('Public field', { exact: true }).fill('safe note')
        await root.getByRole('checkbox', { name: 'Choose 4', exact: true }).check()
        await root.getByRole('textbox', { name: /^Amount/ }).fill('3')
        assert.equal(await root.getByRole('checkbox', { name: 'Choose 6', exact: true }).isChecked(), true)
        await root.getByRole('textbox', { name: /^Amount/ }).fill('-')
        await root.getByRole('button', { name: 'Amount section', exact: true }).click()
        assert.equal(await root.getByRole('button', { name: 'Send computed', exact: true }).isDisabled(), true)
        await root.getByRole('button', { name: 'Amount section', exact: true }).click()
        assert.equal(await root.getByRole('textbox', { name: /^Amount/ }).inputValue(), '-')
        await page.waitForFunction(() => Object.values(JSON.parse(localStorage.getItem('dsh.genui.interaction') || '{"blocks":{}}').blocks)
          .some(state => state.fields?.amount === '-' && state.fields?.note === 'safe note'))
        assert.equal(await page.evaluate(() => JSON.stringify(localStorage).includes('SYNTHETIC_SECRET_TEST_ONLY')), false)
        await page.reload({ waitUntil: 'domcontentloaded' })
        await root.getByRole('textbox', { name: /^Amount/ }).waitFor({ state: 'visible', timeout: 15000 })
        assert.equal(await root.getByRole('textbox', { name: /^Amount/ }).inputValue(), '-')
        assert.equal(await root.getByRole('button', { name: 'Send computed', exact: true }).isDisabled(), true)
        report.hostDraftAndSecret = true
        /** 从当前组件下载指定格式的导出文件。 */
        const download = async format => {
          await root.getByRole('button', { name: /^(导出|Export)$/ }).click()
          const pending = page.waitForEvent('download')
          await root.getByRole('menuitem', { name: format === 'html' ? 'HTML' : 'GenUI JSON', exact: true }).click()
          const file = join(artifactsDir, `computed-acceptance.${format}`)
          await (await pending).saveAs(file)
          return file
        }
        const jsonFile = await download('json')
        const artifactText = await readFile(jsonFile, 'utf8')
        const artifact = JSON.parse(artifactText)
        assert.deepEqual(artifact.state.fields, { note: 'safe note', amount: '-' })
        assert.deepEqual(artifact.state.multiAnswers.choices, ['Choose {{total}}'])
        assert.ok(!artifactText.includes('SYNTHETIC_SECRET_TEST_ONLY'))
        const htmlFile = await download('html')
        standalone = await browser.newPage({ viewport: { width: 480, height: 640 }, locale: 'zh-CN' })
        const errors = []
        standalone.on('pageerror', error => errors.push(error.message))
        await standalone.goto(pathToFileURL(htmlFile).href)
        await standalone.getByRole('textbox', { name: /^Amount/ }).waitFor({ state: 'visible' })
        assert.equal(await standalone.getByRole('textbox', { name: /^Amount/ }).inputValue(), '-')
        assert.equal(await standalone.getByRole('checkbox').isChecked(), true)
        await standalone.getByRole('textbox', { name: /^Amount/ }).fill('3')
        await standalone.getByText('Result 6', { exact: true }).waitFor({ state: 'visible' })
        assert.equal(await standalone.getByRole('checkbox', { name: 'Choose 6', exact: true }).isChecked(), true)
        await standalone.getByRole('textbox', { name: /^Amount/ }).fill('')
        await standalone.locator('canvas').first().waitFor({ state: 'visible' })
        // 从真实 Canvas 读取像素:真实零值有颜色,缺失值没有图块。
        // 取样点避开标签、边框与坐标轴,并等待 ECharts 完成重绘。
        await assertHeatmapPixels(standalone, true)
        await standalone.screenshot({ path: join(artifactsDir, 'computed-standalone-missing-value.png'), fullPage: true })
        await standalone.getByRole('textbox', { name: /^Amount/ }).fill('0')
        await assertHeatmapPixels(standalone, false)
        await standalone.screenshot({ path: join(artifactsDir, 'computed-standalone-zero-value.png'), fullPage: true })
        report.heatmapPixels = { realZeroPainted: true, missingCellAbsent: true, repairedZeroPainted: true }
        assert.deepEqual(errors, [])
        report.exportAndStandalone = true
        await root.getByRole('tab', { name: 'Public', exact: true }).click()
        assert.equal(await root.getByLabel('Public field', { exact: true }).inputValue(), 'safe note')
        await root.getByRole('textbox', { name: /^Amount/ }).fill('3')
        assert.equal(await root.getByRole('checkbox', { name: 'Choose 6', exact: true }).isChecked(), true)
        await root.screenshot({ path: join(artifactsDir, 'computed-host-ready.png') })
        report.action = await verifySubmit(root)
        report.passed = true
      } catch (error) {
        report.error = String(error)
        throw error
      } finally {
        await standalone?.close()
        await writeFile(join(artifactsDir, 'computed-browser-results.json'), `${JSON.stringify(report, null, 2)}\n`)
      }
    }
    
    /** 检查热力图 Canvas 中真实零值与缺失值的像素差异。 */
    export async function assertHeatmapPixels(page, missing) {
      await page.waitForFunction(missing => {
            const canvas = document.querySelector('canvas')
            if (!canvas) return false
            const context = canvas.getContext('2d')
            const alpha = fraction => context.getImageData(Math.floor(canvas.width * fraction), Math.floor(canvas.height * 0.3), 1, 1).data[3]
            return alpha(0.4) > 240 && (missing ? alpha(0.8) === 0 : alpha(0.8) > 240)
          }, missing, { timeout: 10000 })
    }
    
  • scripts/e2e-gallery-host.mjs13 KB3a0ffa92a9fdupstream ↗
    /** 为固定宿主的无密钥 smoke 验收提供真实会话校验;运行文件存放在本次 DSH_HOME。 */
    import assert from 'node:assert/strict'
    import { randomUUID } from 'node:crypto'
    import { mkdir, readFile, writeFile, access, copyFile } from 'node:fs/promises'
    import { join } from 'node:path'
    import { fileURLToPath } from 'node:url'
    
    import { computedSpec, panelBase, panelAppend, editPanelBeforeAppend, checkPanelAfterAppend, runComputedBrowserChecks } from './computed-browser-checks.mjs'
    
    /** 将组件 spec 编码为 DSH 正文中的 dsh-ui 围栏。 */
    const fence = spec => `\`\`\`dsh-ui\n${JSON.stringify(spec)}\n\`\`\``
    const COMPUTED_ACK = 'Synthetic computed submission received.'
    const ACK = 'Synthetic gallery choice received.'
    const INITIAL = 'Display the synthetic gallery fixture.'
    const TITLE = 'Gallery browser synthetic conversation'
    
    /** 将给定文字组成官方 ReplayAdapter 使用的响应片段。 */
    export function replayChunks(text) {
      return { kind: 'chunks', chunks: [
        { type: 'block-start', index: 0, blockType: 'text' },
        { type: 'text-delta', index: 0, text },
        { type: 'block-end', index: 0, block: { type: 'text', text } },
        { type: 'finish', reason: { kind: 'stop' } },
      ] }
    }
    
    /** 构造隔离的 smoke 环境变量,仅传入运行测试所需设置。 */
    export function gallerySmokeEnvironment(source, dshHome) {
      const allow = new Set(['PATH', 'HOME', 'TMPDIR', 'TMP', 'TEMP', 'LANG', 'LANGUAGE',
        'LC_ALL', 'LC_CTYPE', 'TZ', 'TERM', 'NODE_EXTRA_CA_CERTS', 'SSL_CERT_FILE', 'SSL_CERT_DIR'])
      // Provider/account keys, NODE_OPTIONS preload hooks, DSH_* settings and user
      // configuration overrides are deliberately not inherited by the test host.
      return { ...Object.fromEntries(Object.entries(source).filter(([key]) => allow.has(key) || /_proxy$/iu.test(key))), DSH_HOME: dshHome }
    }
    
    /** 在真实宿主中建立本地 ReplayAdapter 会话并打开浏览器页面。 */
    export async function prepareGalleryConversation({ dshRoot, dshHome, spec, publishedHost }) {
      const host = publishedHost === undefined
        ? JSON.parse(await readFile(join(dshRoot, 'apps/cli/package.json'), 'utf8'))
        : { version: publishedHost.hostVersion }
      // Minimum rc.1 continues to run the reusable DOM-fence visual checks only.
      if (host.version === '0.2.0-rc.1') return null
      assert.ok(['0.2.1-rc.3', '0.2.1-rc.5', '0.2.2-alpha.2'].includes(host.version), 'Unrecognized host must not silently skip conversation coverage')
      const replayModule = publishedHost?.modules.replayModule ?? join(dshRoot, 'packages/test-support/llm-replay/lib/index.js')
      await access(replayModule) // Missing official build output is a failure, not a skip.
      const root = join(dshHome, 'gallery-e2e')
      await mkdir(join(root, 'workspace'), { recursive: true })
      const sessionId = `session-e2e-gallery-${randomUUID()}`
      const initialRequestId = `gallery-initial-${randomUUID()}`
      const auditFile = join(root, 'events.jsonl')
      const replayFile = join(root, 'replay.json')
      const config = { sessionId, provider: 'gallery-e2e-replay', model: 'gallery-e2e', replayModule, replayFile, auditFile }
      await writeFile(auditFile, '')
      const initialText = [spec, computedSpec, panelBase].map(fence).join('\n\n')
      const choiceText = `${ACK}\n\n${fence(panelAppend)}`
      await writeFile(replayFile, JSON.stringify([replayChunks(initialText), replayChunks(choiceText), replayChunks(COMPUTED_ACK)]))
      const patchFile = join(root, 'cordis.patch.yml')
      // Loader discovers client packages through the nearest package.json. Mounting
      // scripts/fixtures directly would make this a second GenUI client source next
      // to the installed tarball. Give the unchanged host-only fixture its own
      // disposable package boundary; do not symlink back into the repository.
      const fixtureRoot = join(root, 'host-fixture')
      await mkdir(fixtureRoot, { recursive: true })
      await writeFile(join(fixtureRoot, 'package.json'), JSON.stringify({
        name: 'dsh-genui-gallery-e2e-host-fixture', version: '0.0.0', private: true, type: 'module',
      }))
      const plugin = join(fixtureRoot, 'index.mjs')
      await copyFile(fileURLToPath(new URL('./fixtures/gallery-host.mjs', import.meta.url)), plugin)
      // JSON is YAML-compatible; the official --patch loader owns application.
      await writeFile(patchFile, JSON.stringify([
        { id: 'agent-default-model', config: { provider: config.provider, model: config.model } },
        { insert: [{ id: 'e2e-gallery-host', name: plugin, config }] },
      ]))
      /** 读取宿主写入的会话审计记录。 */
      const readAudit = async () => (await readFile(auditFile, 'utf8')).split('\n').filter(Boolean).map(JSON.parse)
      /** 检查会话记录中不存在未授权动作。 */
      const audit = async () => {
        const rows = await readAudit()
        assert.deepEqual(rows.filter(row => row.type === 'agent-error' || row.allowed === false), [], 'Synthetic host reported a rejected request or AgentLoop error')
        return rows
      }
      /** 反复检查真实宿主状态,直到条件满足或宿主进程退出。 */
      const waitFor = async (predicate, label) => {
        const deadline = Date.now() + 30000
        do {
          const rows = await audit()
          if (predicate(rows)) return rows
          await new Promise(resolve => setTimeout(resolve, 50))
        } while (Date.now() < deadline)
        assert.fail(`${label} did not settle within 30 seconds`)
      }
      /** 提取宿主审计记录中的文本内容。 */
      const textOf = row => row.message.content.filter(part => part.type === 'text').map(part => part.text).join('')
      // The host also appends user-role runtime-context/time-context snapshots.
      // Only source.kind=user represents admitted client input and carries rpcId.
      /** 筛选由用户界面提交的消息。 */
      const users = rows => rows.filter(row => row.type === 'user-message' && row.message.source.kind === 'user')
      /** 确认本地 ReplayAdapter 尚未收到动作请求。 */
      const assertNoActions = async () => {
        const rows = await audit()
        const inputs = users(rows)
        assert.equal(inputs.length, 1, 'Browsing must not submit another user message')
        assert.equal(inputs[0].sessionId, sessionId)
        assert.equal(inputs[0].message.source.rpcId, initialRequestId)
        assert.equal(textOf(inputs[0]), INITIAL)
        assert.equal(rows.filter(row => row.type === 'llm-route').length, 1, 'Browsing must not invoke the model')
        return { userMessages: 1, genuiActions: 0, replayCalls: 1 }
      }
      let workspaceId = null
      /** 打开本次 DSH 会话,并按需要关闭凭据提示。 */
      const openExistingConversation = async ({ page, dismissCredentialsOverlay }) => {
        assert.ok(workspaceId, 'Create the one gallery session before selecting it in another context')
        await assertNoActions()
        await page.reload({ waitUntil: 'domcontentloaded', timeout: 30000 })
        await dismissCredentialsOverlay()
        const workspaceRow = page.locator(`[data-row-key="workspace:${workspaceId}"]`)
        await workspaceRow.waitFor({ state: 'visible', timeout: 15000 })
        if (await workspaceRow.getAttribute('aria-expanded', { timeout: 15000 }) === 'false') await workspaceRow.click({ timeout: 15000 })
        const title = page.getByText(TITLE, { exact: true }).and(page.locator(':visible'))
        await title.waitFor({ state: 'visible', timeout: 15000 })
        assert.equal(await title.count(), 1, 'Created session title must have one visible UI target')
        await title.click({ timeout: 15000 })
        const renderedRoot = page.locator('[data-chat-flow-kind="assistant-step"] [data-genui]').filter({ has: page.getByRole('group', { name: 'Gallery browser cards', exact: true }) })
        await renderedRoot.waitFor({ state: 'visible', timeout: 15000 })
        assert.equal(await renderedRoot.count(), 1, 'Real assistant must render one gallery fence')
        await assertNoActions()
        return renderedRoot
      }
      return {
        webArgs: ['--patch', patchFile], cwd: join(root, 'workspace'), sessionId, auditFile,
        openExistingConversation,
        /** 创建一次本地回放会话并打开对应页面。 */
        async openConversation({ page, dismissCredentialsOverlay }) {
          assert.equal(workspaceId, null, 'The replay fixture must be created and prompted only once')
          await waitFor(rows => rows.some(row => row.type === 'ready'), 'Replay configuration')
          /** 通过浏览器主进程调用会话 RPC。 */
          const rpc = async (method, request) => {
            const response = await page.request.post(new URL(`/api/${method}`, page.url()).href, {
              data: { type: 'client-request', rpcId: randomUUID(), method, payload: { args: { request } } }, timeout: 15000,
            })
            assert.ok(response.ok(), `${method}: HTTP ${response.status()}`)
            const payload = await response.json()
            assert.equal(payload.result?.ok, true, `${method}: ${JSON.stringify(payload)}`)
            return payload.result.value
          }
          const { workspace } = await rpc('workspace/create', { path: join(root, 'workspace') })
          workspaceId = workspace.workspaceId
          const created = await rpc('session/create', { workspaceId: workspace.workspaceId, sessionId })
          assert.equal(created.sessionId, sessionId, 'Must use the actual created session')
          await rpc('session/rename', { sessionId, title: TITLE })
          const receipt = await rpc('session/prompt', { sessionId, requestId: initialRequestId, mode: 'queue', content: [{ type: 'text', text: INITIAL }] })
          assert.equal(receipt.accepted, true)
          const rows = await waitFor(rows => rows.some(row => row.type === 'turn-end' && row.turn === 1), 'Initial real assistant turn')
          assert.equal(rows.find(row => row.type === 'turn-end' && row.turn === 1).reason.kind, 'completed')
          const assistant = rows.filter(row => row.type === 'assistant-message')
          assert.equal(assistant.length, 1)
          assert.equal(textOf(assistant[0]), initialText)
          return openExistingConversation({ page, dismissCredentialsOverlay })
        },
        assertNoActions,
        editPanelBeforeAppend, checkPanelAfterAppend,
        /** 在已安装的固定宿主中验收计算组件和提交动作。 */
        async verifyComputed({ page, browser, artifactsDir }) {
          return runComputedBrowserChecks({ page, browser, artifactsDir, verifySubmit: async renderedRoot => {
            await renderedRoot.getByRole('button', { name: 'Send computed', exact: true }).click()
            await waitFor(rows => rows.some(row => row.type === 'replay-consumed'), 'Computed Submit and third replay turn')
            await page.getByText(COMPUTED_ACK, { exact: true }).waitFor({ state: 'visible' })
            await page.waitForTimeout(1000)
            const rows = await audit()
            const inputs = users(rows)
            assert.equal(inputs.length, 3, 'Computed submit must create exactly one new input')
            const action = inputs[2]
            assert.equal(action.sessionId, sessionId)
            assert.ok(textOf(action).startsWith('[genui-action] computed-submit。'))
            const payload = JSON.parse(textOf(action).split(' 组件数据: ')[1])
            assert.deepEqual(payload.fields, { note: 'safe note', amount: '3' })
            assert.deepEqual(payload.answers.choices, ['Choose 6'])
            assert.ok(!JSON.stringify(rows).includes('SYNTHETIC_SECRET_TEST_ONLY'))
            assert.equal(rows.filter(row => row.type === 'llm-route').length, 3)
            assert.deepEqual(rows.filter(row => row.type === 'turn-end').map(row => row.reason.kind), ['completed', 'completed', 'completed'])
            return { userMessages: 3, genuiActions: 2, replayCalls: 3, fields: payload.fields, choices: payload.answers.choices }
          } })
        },
        async verifyChoose({ page, renderedRoot, dismissCredentialsOverlay }) {
          await assertNoActions()
          await dismissCredentialsOverlay()
          await renderedRoot.getByRole('button', { name: 'Choose One', exact: true }).click({ timeout: 15000 })
          await waitFor(rows => rows.some(row => row.type === 'turn-end' && row.turn === 2), 'Real Choose action and second replay turn')
          await page.getByText(ACK, { exact: true }).waitFor({ state: 'visible', timeout: 15000 })
          // Include the renderer's trailing debounce window before final counts.
          await page.waitForTimeout(1000)
          const rows = await audit()
          const inputs = users(rows)
          assert.equal(inputs.length, 2, 'One Choose click must create exactly one additional user input')
          const action = inputs[1]
          assert.equal(action.sessionId, sessionId)
          assert.equal(action.message.source.kind, 'user')
          assert.ok(typeof action.message.source.rpcId === 'string' && action.message.source.rpcId.length > 0)
          assert.notEqual(action.message.source.rpcId, initialRequestId)
          assert.ok(textOf(action).startsWith('[genui-action] gallery-choose-one。'))
          const payload = JSON.parse(textOf(action).split(' 组件数据: ')[1])
          assert.equal(payload.type, 'button')
          assert.equal(payload.label, 'Choose One')
          const assistants = rows.filter(row => row.type === 'assistant-message')
          assert.equal(assistants.length, 2)
          assert.equal(textOf(assistants[1]), choiceText)
          assert.equal(rows.filter(row => row.type === 'llm-route').length, 2)
          assert.deepEqual(rows.filter(row => row.type === 'turn-end').map(row => row.reason.kind), ['completed', 'completed'])
          return { sessionId, genuiActions: 1, replayCalls: 2, actionRequestId: action.message.source.rpcId }
        },
      }
    }
    
  • scripts/e2e-map-host.mjs10 KBba3bcf2d650cupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • scripts/e2e-visual.mts37 KB36aaf810a054upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • scripts/e2e.mjs43 KB93ad20e9775fupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • scripts/gallery-browser-checks.mjs33 KB03129d855bcaupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • scripts/gallery-fixed-contexts.mjs7.7 KBcc527f29d6b4upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • scripts/gallery-input-mode.mjs2.7 KBc3b26987be22upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • scripts/gallery-touch-checks.mjs7.8 KB9b4d0cc2ae36upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • scripts/generate-icon-data.mjs9.3 KB53284e41bbb9upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • scripts/genui-usage-audit.mjs10 KBd8c5777341ecupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • scripts/host-dependency-policy.mjs733 Bf93269788e1eupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • scripts/install.sh6.6 KBf977a3a381f1upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • scripts/map-acceptance/browser-checks.mjs8.2 KB30f0e2c4a077upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • scripts/map-acceptance/contract.mjs4.8 KB2adb452d3d66upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • scripts/map-acceptance/run.mjs20 KBd3d49cafe34bupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • scripts/prepack.mjs911 B585b627029c7upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • scripts/prepare-published-host.mjs2.4 KBcb033f8ebdaeupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • scripts/sidechat-acceptance/ci.mjs8.1 KB4b6560f205e7upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • scripts/sidechat-acceptance/fixture/lib/index.mjs18 KBae487a6b68d4upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • scripts/sidechat-acceptance/fixture/lib/snapshot-diagnostics.mjs3.8 KBc7e10e52e587upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • scripts/sidechat-acceptance/fixture/lib/spec.mjs1.4 KB26fd87a69635upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • scripts/sidechat-acceptance/fixture/lib/ui-away.mjs1.6 KB64ae6c5dc3e5upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • scripts/sidechat-acceptance/fixture/replay/first-child.v4.jsonl2.1 KB6c3b88b9c3c6upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • scripts/sidechat-acceptance/fixture/replay/second-child.v4.jsonl2.1 KB54c2ee1f6cdeupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • scripts/sidechat-acceptance/scripts/exact-pack.mjs3.4 KB9fba42ab4b9dupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • scripts/sidechat-acceptance/scripts/owned-process.mjs4.2 KB6a2e2b353884upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • scripts/sidechat-acceptance/scripts/run-sidechat-acceptance.mjs18 KB7884026cce38upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • scripts/sidechat-acceptance/scripts/sidechat-away-navigation.mjs3.9 KBc62c60c9ddd1upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • scripts/sidechat-acceptance/scripts/sidechat-backend-oracle.mjs9.3 KB18d0f2a2cf51upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • scripts/sidechat-acceptance/scripts/sidechat-browser-checks.mjs17 KB30eb59a0abb3upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • scripts/sidechat-acceptance/scripts/sidechat-browser-contracts.mjs8.0 KB2c91278077c6upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • scripts/sidechat-acceptance/scripts/sidechat-browser-locators.mjs796 B605b33d2cdeaupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • scripts/sidechat-acceptance/scripts/sidechat-browser-transport.mjs2.3 KBc5d8272d134cupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • scripts/sidechat-acceptance/scripts/sidechat-host-contract.mjs7.4 KB5492c8e67cb1upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • scripts/sidechat-acceptance/scripts/sidechat-onboarding.mjs12 KBe74923531b4fupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • scripts/sidechat-acceptance/tests/ci.test.mjs19 KB61fe311e42e4upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • scripts/sidechat-acceptance/tests/exact-pack.test.mjs1.5 KB3d4a28c207b6upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • scripts/sidechat-acceptance/tests/host-resolution.test.mjs4.3 KBfae5db393f12upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • scripts/sidechat-acceptance/tests/independent-review.test.mjs6.7 KBb295c29b6bfbupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • scripts/sidechat-acceptance/tests/owned-process.test.mjs1.9 KBfcd1c9eec60bupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • scripts/sidechat-acceptance/tests/owned-root.test.mjs1.3 KB005c0bca7ef2upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • scripts/sidechat-acceptance/tests/sidechat-away-navigation.test.mjs8.9 KBad9ed00cd459upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • scripts/sidechat-acceptance/tests/sidechat-backend-oracle.test.mjs9.0 KB6c722b11680cupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • scripts/sidechat-acceptance/tests/sidechat-browser-contracts.test.mjs7.7 KB575e783d28eeupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • scripts/sidechat-acceptance/tests/sidechat-host-contract.test.mjs5.6 KBd21a5ff4992cupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • scripts/sidechat-acceptance/tests/sidechat-onboarding.test.mjs11 KB392ec2d0fa0cupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • scripts/sidechat-acceptance/tests/sidechat-system-head.test.mjs2.7 KBbf07c9999303upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • scripts/sidechat-acceptance/tests/snapshot-diagnostics.test.mjs5.5 KB0c456b5ce290upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • scripts/sidechat-acceptance/tests/transport-review.test.mjs4.8 KB75f3d60d8a20upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • scripts/verify-pack.mjs5.7 KB44d080aac2fbupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • assets/demo-thumb.png158 KB61a714d56649upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • assets/demo.mp42.5 MBaa390d945bcfupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • assets/genui-icon.svg982 Bc2c0237f9f59upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • assets/genui-logo.svg1.4 KB9e9c1b5c72b1upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • assets/showcase-panel.png88 KB0c36677eb124upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • assets/showcase-plot.png70 KB3455ee065fa5upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • assets/showcase.png82 KB735db703398cupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • .github/workflows/ci.yml13 KB6e65d394847cupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • .github/workflows/deploy-product-site.yml1.4 KBcd164ed0ed9fupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • .github/workflows/release.yml8.8 KBfcd503bb56beupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • .gitignore268 B3abdbd388258upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • .npmrc25 Bf301fedf982fupstream ↗
    auto-install-peers=false
    
  • AGENTS.md2.5 KBe630613f8c61upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • CHANGELOG.md97 KB31e6de9351edupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • cordis.patch.yml473 Bb71faa6d630fupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • demo-prompts.md6.6 KB625ef5582d0bupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • docs/copy-preview.md3.0 KBe441349b7d1aupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • docs/diagram-component-design.md11 KBb22374d89be9upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • docs/dsh-go.md5.7 KB74e47a154305upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • docs/gallery.md5.2 KB73f4b56bffecupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • docs/hub-registration.md1.7 KB194083d44c6bupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • docs/map.md9.5 KBe9af1956cafcupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • docs/plans/2026-08-11-dsh-genui-hardening-execution-plan.md51 KB2ef8cea8df2dupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • docs/plans/2026-08-12-dsh-genui-design-optimization.md35 KBebc7d3ca3486upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • docs/plans/2026-09-08-genui-upgrade-research.md26 KB4946d82044eeupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • docs/plans/2026-10-13-dsh-genui-anthological-aesthetics.md22 KB758d42104511upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • docs/screenshots/achievements.png95 KB5ce38e9ba84dupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • docs/screenshots/issue-159-light-surface.png186 KBf63986cd47a5upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • docs/screenshots/issue-183-wordcloud-svg.png133 KB1a5a98f9ed2aupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • docs/screenshots/template-center.png116 KBdce25f289faeupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • docs/sidechat-surfaces.md4.7 KBc7fcd57aaa82upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • ICON-NAMES.md9.6 KB84c67b14d295upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • LICENSE1.0 KBa2078e705ad7upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • package.json10 KBaa22dc583e71upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • pnpm-lock.yaml269 KBc75befce8f86upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • pnpm-workspace.yaml3.6 KBe3bc8050564fupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • README.zh-CN.md22 KB95367775749fupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • site/assets/demo-thumb.png158 KB61a714d56649upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • site/assets/demo.mp42.5 MBaa390d945bcfupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • site/assets/github-octocat-original_b664c28d.png18 KBe6ff2b490512upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • site/assets/index-BtlSWbij.css162 KB3d0b5a4863c1upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • site/assets/index-CbA0uR5g.js601 KBedd525a24d05upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • site/assets/showcase-panel.png82 KBfe0909e2fa89upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • site/assets/showcase-plot.png38 KB1e10628df7a2upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • site/assets/showcase.png45 KBc717936b17c4upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • site/index.html360 KBcd5d50ca9ecaupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • src/client/achievement-store.ts5.0 KB6dba6c8f2fd9upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • src/client/achievement-toast.tsx2.6 KB641f876a3172upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • src/client/achievements.ts6.2 KBb2610dda6eaaupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • src/client/action-context.ts897 B7c0c80a7afdbupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • src/client/artifact/ArtifactExport.module.css2.4 KB79ce25549876upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • src/client/artifact/create.ts3.4 KB1fff9621d407upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • src/client/artifact/download.ts1.9 KB80e8c7e93fc3upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • src/client/artifact/ExportableGenuiBlock.tsx5.3 KB8746bb732e8cupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • src/client/artifact/html.ts7.9 KB4893c0c47d90upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • src/client/artifact/index.ts566 B0ea408b162d3upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • src/client/artifact/json.ts222 B1cf73a49e74cupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • src/client/artifact/parse.ts2.1 KB5162120f56a6upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • src/client/artifact/portability.ts4.1 KB6fbb0adbbcecupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • src/client/artifact/standalone-theme.ts5.0 KB3ff2ae068691upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • src/client/artifact/types.ts1.3 KBd74f02909425upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • src/client/asset-echarts-core.ts1.8 KB69b16135d349upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • src/client/asset-echarts.ts1.3 KB6287dd8fb76aupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • src/client/asset-loader.ts4.1 KB5d65b2a18d9dupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • src/client/asset-maplibre.ts220 B0300f0c76e83upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • src/client/asset-mermaid.ts646 B164f956cd0d5upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • src/client/asset-three.ts526 Be7ff54210d9aupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • src/client/blocks/advanced.tsx27 KBe9523fd4eae2upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • src/client/blocks/basic.tsx4.5 KB833eb8d16d46upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • src/client/blocks/blocks.tsx6.8 KB4ab1208ab244upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • src/client/blocks/carousel.tsx6.0 KB5eb12a27d5c0upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • src/client/blocks/charts.tsx50 KBeb6e8d553e7bupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • src/client/blocks/checkbox.tsx2.5 KB33b4fcf62cf4upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • src/client/blocks/choices.module.css4.2 KB47d6022914b3upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • src/client/blocks/choices.tsx6.2 KBf0c6c58129e7upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • src/client/blocks/compare.module.css5.2 KB581a6f9ad853upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • src/client/blocks/compare.tsx8.5 KB7994574cd2aaupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • src/client/blocks/date-picker.module.css955 Be107e64b17bbupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • src/client/blocks/date-picker.tsx4.8 KBa7c728963c60upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • src/client/blocks/diagram/geometry.ts5.7 KB5079e3015c97upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • src/client/blocks/diagram/index.tsx16 KBef5a807854e9upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • src/client/blocks/diagram/layout.ts6.8 KB330711aabbcaupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • src/client/blocks/diagram/theme.ts4.9 KB38a16e401d4cupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • src/client/blocks/editor.module.css1.0 KB4f41570a6c7dupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • src/client/blocks/editor.tsx2.9 KB9338e7112102upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • src/client/blocks/entity-card.module.css2.4 KB50a7e5812f70upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • src/client/blocks/entity-card.tsx3.1 KB956a0009b22aupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • src/client/blocks/forms.tsx23 KBac4769803ddfupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • src/client/blocks/gallery.module.css5.3 KB5736d549025cupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • src/client/blocks/icon.tsx3.5 KB6228eb570468upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • src/client/blocks/image-group.tsx8.3 KB26534f2d82b1upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • src/client/blocks/image.tsx1.2 KB7559946f6742upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • src/client/blocks/map.module.css1.4 KB07978f638aa2upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • src/client/blocks/map.tsx5.5 KB7776d71ae384upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • src/client/blocks/popover.module.css1.2 KB5f8543a213dcupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • src/client/blocks/popover.tsx4.1 KBcee49ad933a8upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • src/client/blocks/render-node.tsx30 KB7ac62de65953upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • src/client/blocks/segmented-control.module.css1.3 KBef69dee667ffupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • src/client/blocks/segmented-control.tsx2.8 KBb2bfac32b31dupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • src/client/blocks/skeleton.tsx6.3 KB5fbe34f87c1cupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • src/client/blocks/state.ts3.6 KBa3dc24c83b9bupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • src/client/blocks/svg.tsx3.1 KBcf46d9c15a8dupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • src/client/computed.ts16 KB47967b042c9bupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • src/client/conditions.ts8.4 KB8a0797d49beaupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • src/client/copy-preview-state.ts1.4 KB4d7d5c2337deupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • src/client/date-picker.ts1.1 KB93f2162db661upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • src/client/dom-fence.tsx88 KB8ff11b209850upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • src/client/EChartNode.tsx23 KB6caf9b218926upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • src/client/echarts-engine.ts454 B3a1714ac9087upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • src/client/echarts-lazy.ts1.6 KB008ea5e4d446upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • src/client/embed.ts1.0 KB7317b5100610upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • src/client/ErrorBoundary.tsx2.2 KB33216add2edbupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • src/client/fence-render.tsx11 KB0b00880256e5upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • src/client/file-address.ts1.8 KB77f6a83d9184upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • src/client/file-link-context.tsx4.4 KB1dce58643e2bupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • src/client/file-link.ts1.7 KB15c662444bd1upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • src/client/gallery.ts17 KB09ccc6082b58upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • src/client/genui-runtime/diagnostics.ts7.6 KBf64d6c51c85cupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • src/client/genui-runtime/index.ts43 B09eca5faccdfupstream ↗
    export { GENUI_LIMITS } from './limits.ts'
    
  • src/client/genui-runtime/limits.ts2.5 KBbfb4b86d6631upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • src/client/genui-runtime/normalize.ts17 KB81b6d43d9af1upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • src/client/genui-runtime/schema.ts27 KB27a0a644165aupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • src/client/genui-runtime/value-utils.ts3.3 KB1508c0e9d82eupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • src/client/GenuiBlock.module.css111 KBe78f0b8480a6upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • src/client/GenuiBlock.tsx18 KB18cf766c5373upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • src/client/guard.ts120 KB120f77a7ec67upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • src/client/i18n/en.ts23 KBda72e0bc45a6upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • src/client/i18n/index.ts3.9 KB3fd9effddc5bupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • src/client/i18n/runtime.ts4.8 KB14e3333f6a0dupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • src/client/i18n/zh.ts22 KBa6e1fa620fdcupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • src/client/icons/asset-icons.ts741 B556aa787d921upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • src/client/icons/icon-data-full.ts992 KBd462809243b7upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • src/client/icons/icon-data.ts70 KBcb44fce434d9upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • src/client/icons/icon-lazy.ts3.4 KBbffa02492bc6upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • src/client/icons/icon-names-full.ts11 KBdf903c728e98upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • src/client/index.tsx12 KB993ba2ab2753upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • src/client/inline.ts5.8 KB9554c31a4047upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • src/client/interaction-store.ts4.6 KB256e20db8140upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • src/client/map-config.ts1.4 KBd41836f50bc4upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • src/client/map-core.ts8.6 KB5ccda0b91777upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • src/client/map-data.ts6.2 KB5e4b63954432upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • src/client/map-lazy.ts771 Bd97f478fea7eupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • src/client/map-worker-ownership.ts314 Bcb9f1bc7bd92upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • src/client/maplibre-resources.ts156 B3de7e4232233upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • src/client/mermaid-colors.ts1.6 KB6b5be36b3d12upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • src/client/mermaid-core.ts7.8 KBab6bd672b06fupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • src/client/mermaid-lazy.ts4.6 KBc9a1c61d5e55upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • src/client/mermaid-safe.ts7.3 KB3efd93cd96c8upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • src/client/panel-command.ts6.7 KB1edc1c00bbb4upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • src/client/panel-store.ts25 KB83375f18a38cupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • src/client/panel.tsx13 KB5c03330828c5upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • src/client/parse-partial.ts7.8 KBeee2dda04cd7upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • src/client/PlotBlock.module.css5.4 KBd9767218562fupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • src/client/PlotBlock.tsx20 KBc7a314f69a24upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • src/client/primitive-adapter.ts196 B79cbd56149eaupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • src/client/primitive-labels.ts2.1 KBce0050c8c92fupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • src/client/safe-math.ts12 KB7f54011328e6upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • src/client/scene3d-core.ts7.2 KB571986869db3upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • src/client/scene3d-lazy.ts1.1 KB6f126c0fb751upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • src/client/session-resolver.ts843 B47301561d544upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • src/client/sidechat-surface.tsx11 KB48aed710c16eupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • src/client/source-fence.ts2.5 KB70739b500a2bupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • src/client/spec.ts42 KB3593cbfe435aupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • src/client/standalone/asset-loader.ts587 B6d35958eaf6fupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • src/client/standalone/bootstrap-types.ts220 B3f1bdd7f7093upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • src/client/standalone/katex-style.ts10 B336ce12bb910upstream ↗
    export {}
    
  • src/client/standalone/primitive-adapter.tsx3.9 KB50805bcd0b97upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • src/client/standalone/runtime.tsx1.1 KBc0957666a995upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • src/client/streaming-shape.ts5.9 KB9982061058fbupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • src/client/submission-registry.ts8.3 KB88548a17fea0upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • src/client/svg-fence.tsx1.8 KB3299bad54c1bupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • src/client/table-details.ts8.7 KB08afcd106b84upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • src/client/table-export.ts1.3 KB58e86b40f609upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • src/client/TemplateDrawer.module.css3.4 KBf2cd8515a47aupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • src/client/TemplateDrawer.tsx5.9 KB919e4e1c1b3fupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • src/client/templates.ts13 KBe8abc1222afdupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • src/client/toolview.tsx3.3 KBbbd29cfbd040upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • src/client/walk-spec.ts2.4 KBfe83a9f418c4upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • src/css-modules.d.ts172 Bd71041112609upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • src/index.ts410 B33dac7003a79upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • src/plugin/chart-contract.ts515 B2d73ea0a33ebupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • src/plugin/dsh-go-compiler.ts20 KB08bb68c865f3upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • src/plugin/dsh-go-native.ts17 KBc01719f3e314upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • src/plugin/dsh-go-submission.ts1.6 KB3ebcdf5e067dupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • src/plugin/dsh-go-types.ts1.3 KB0caeec8a5d84upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • src/plugin/dsh-go-view.ts538 Be3cfad798f58upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • src/plugin/fence-feedback.ts31 KB804c6aedf4b9upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • src/plugin/genui-diagnostic.ts4.9 KB04a60163566aupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • src/plugin/index.ts13 KB6d215c2fe69bupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • src/plugin/inline-content-diagnostic.ts6.9 KBbc9705801db6upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • src/plugin/node-shims.d.ts959 B8ddc020f28a0upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • src/plugin/tool.ts21 KBdc777bb1e2d2upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • src/shared/fence-language.ts1.4 KB8e78c2a2e95bupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • src/shared/fence-repair.ts29 KB265647700ebfupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • src/shared/fence-resolve.ts3.2 KBce09bcdb4d8cupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • src/shared/panel-merge.ts1.7 KBd3bf52739aaaupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tests/achievements.spec.ts4.0 KB66c353467395upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tests/browser/blocks-theme.html945 B3ee0933c5b0aupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tests/browser/blocks-theme.README.md2.4 KB604f0d761463upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tests/browser/blocks-theme.tsx5.2 KB1853f0d56503upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tests/browser/content-font-size.html1.5 KB94aaf0daaeccupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tests/browser/interaction-state.html306 B54dc9f6b1ec2upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tests/browser/interaction-state.README.md1.3 KB9778e981d840upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tests/browser/interaction-state.tsx1.0 KB35b49e6cb407upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tests/browser/map.html286 Bd966e81d9cf7upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tests/browser/map.tsx3.8 KB194c6a6502bdupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tests/browser/plot-content-font-size.html1.2 KB933485a19fcbupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tests/browser/steps-marker.html1.0 KB61b668906b14upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tests/browser/steps-marker.README.md3.0 KB71bb37c39571upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tests/browser/steps-marker.tsx4.5 KBda9ec9d19089upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tests/browser/table-wrap.html1.5 KBcded802dca5cupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tests/browser/table-wrap.tsx6.6 KBb785f317b31eupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tests/browser/text-newlines.html1.8 KB98405e1fbe4dupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tests/browser/text-newlines.tsx24 KB88bdb4b38bc1upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tests/dom-fence-container-stream.spec.tsx3.2 KB9dc55511103fupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tests/dom-fence-maintenance.spec.tsx15 KB7bad52286ea9upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tests/dom-fence-ordinals.spec.tsx17 KB67a0329e7269upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tests/dom-fence-raf-cleanup.spec.tsx2.0 KBc870356218fbupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tests/dom-fence-skeleton.spec.tsx3.4 KB60fa132cccf9upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tests/dom-fence.spec.tsx101 KBea5c5ebe368cupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tests/dsh-go-native.spec.ts20 KB30702f2a0142upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tests/dsh-go-view.spec.ts5.3 KB95206d65bd07upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tests/e2e-auth.spec.ts823 B2790024a17d6upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tests/fence-feedback-agentloop.spec.ts6.3 KB7ab7d08f54b8upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tests/fence-feedback.spec.ts53 KB883b1dfbee4cupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tests/fence-repair-cjk-punctuation.spec.ts4.3 KB2cd78224db97upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tests/fence-repair-json-quotes.spec.ts7.1 KB07e823dc7498upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tests/fence-repair-trailing-junk.spec.ts4.6 KBc09e628bf67bupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tests/fence-repair-trim-root.spec.ts1.3 KB9c2e87d48325upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tests/fence-repair-valueless-keys.spec.ts2.4 KBcfc022d23911upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tests/fence-repair-wrapped-key.spec.ts5.8 KB036e7adb156dupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tests/gallery-carousel-settle.spec.ts7.2 KB0f882525f269upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tests/gallery-dialog-controls.spec.ts4.3 KBd18a45aab00bupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tests/gallery-input-mode.spec.ts3.1 KB1666030e2971upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tests/genui-artifact-assets.spec.ts2.2 KB0169e1df6a58upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tests/genui-artifact-html.spec.ts6.6 KB00b5956d306bupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tests/genui-artifact.spec.ts3.5 KBe4afbcf1fee1upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tests/genui-asset-loader.spec.ts3.5 KB57caedceb7e9upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tests/genui-boundaries.spec.tsx13 KBddf7eb431d20upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tests/genui-chart-contract.spec.tsx6.7 KBff3c797cb3b5upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tests/genui-checkbox-group.spec.tsx8.3 KB9cdf6c18cabdupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tests/genui-choices.spec.tsx8.5 KB523e50cced09upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tests/genui-combined-fields.spec.tsx5.5 KB974a0d5ff984upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tests/genui-compare.spec.tsx4.5 KB0dcfa452da94upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tests/genui-computed-checkbox.spec.tsx2.4 KB24d42290e74cupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tests/genui-computed-echart.spec.tsx2.4 KB4f1186d22955upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tests/genui-computed.spec.tsx26 KB2418acf28646upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tests/genui-conditions.spec.tsx14 KBf81302e20a11upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tests/genui-copy-occurrence.spec.tsx6.2 KB3362a517f6d5upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tests/genui-copy-preview.spec.tsx13 KB0aae2821e781upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tests/genui-date-picker.spec.tsx11 KBfc35f9365aa9upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tests/genui-debounce-handler.spec.tsx3.1 KBb436fedbad75upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tests/genui-debounce.spec.tsx5.5 KB87b2e678038eupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tests/genui-diagnostic.spec.ts1.1 KB77f0651c5825upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tests/genui-diagram-guard.spec.ts3.8 KB42c39cd90e5bupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tests/genui-diagram.spec.tsx10 KBd8eab2bd4665upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tests/genui-diff-labels.spec.tsx3.3 KB750d9b1e7dccupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tests/genui-echart-font-size.spec.tsx4.3 KB7b429957b67fupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tests/genui-echart-guard.spec.ts8.9 KB0669e22822a7upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tests/genui-echart.spec.tsx8.3 KB3a5e157395a8upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tests/genui-editor-entity-card-popover.spec.tsx10 KB86e5884203f3upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tests/genui-embed.spec.tsx2.0 KBa0a01ba7dbedupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tests/genui-empty-containers.spec.tsx2.9 KB33bb6ad32dbeupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tests/genui-enable-when.spec.tsx3.7 KB57d6501b9377upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tests/genui-error-boundary.spec.tsx2.4 KB2c22b998469fupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tests/genui-export-state.spec.tsx1.2 KB851de4e64246upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tests/genui-export-ui.spec.tsx5.5 KB50db1373c379upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tests/genui-fence-fallback.spec.tsx17 KBe9b3052145c6upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tests/genui-field-identity.spec.tsx9.6 KB895c13e2760fupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tests/genui-field-name-regression.spec.ts10 KB4e6ad8422191upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tests/genui-figure-primitives.spec.tsx14 KB8dd7cc3583c9upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tests/genui-file-link.spec.tsx16 KB59c0a34f037cupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tests/genui-file-tree-collapse-key.spec.tsx1.6 KBa34cd8deffd0upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tests/genui-file-tree.spec.tsx18 KB66c6f7d7368fupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tests/genui-gallery-contract.spec.ts13 KBf029bf128b75upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tests/genui-gallery-control-scope.spec.tsx5.4 KBa1959331baacupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tests/genui-gallery-feedback.spec.ts8.8 KBa4ba17f3370eupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tests/genui-gallery-render.spec.tsx17 KBb90bedb13f77upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tests/genui-gallery-resolve.spec.tsx934 B1ffca0576266upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tests/genui-gallery.spec.tsx4.0 KBec43ae0ac6b3upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tests/genui-grade-layout.spec.ts1.6 KB74a60a487172upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tests/genui-guard.spec.ts24 KBabecec871ce7upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tests/genui-hardening.spec.tsx10 KB6f9085a2918fupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tests/genui-icon-fidelity.spec.tsx2.6 KBd619c3f5b663upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tests/genui-icon-generator.spec.ts3.1 KB43a100de0f0cupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tests/genui-image.spec.tsx2.4 KB9e3f3940e4c4upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tests/genui-inline.spec.tsx13 KBe59a7838873dupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tests/genui-invalid-input.spec.tsx9.5 KB08e291b96552upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tests/genui-list-item-fields.spec.ts2.4 KB1ca637789107upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tests/genui-map-assets.spec.ts2.7 KB0d7a8a9947c8upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tests/genui-map-browser-contract.spec.ts19 KBcc6039c48250upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tests/genui-map-engine.spec.ts14 KB4f00d0dcf743upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tests/genui-map-guard.spec.ts4.6 KBce7b38f62a17upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tests/genui-map-types.spec.ts2.6 KBf2c9028c2a17upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tests/genui-map-worker-build.spec.ts5.9 KB453ed3f2a110upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tests/genui-map.spec.tsx15 KB7e6cfc180d9cupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tests/genui-markdown.tsx1.7 KB5bb2abb57884upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tests/genui-math-fields.spec.tsx2.2 KB4bb8dfcf5b9dupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tests/genui-media.spec.tsx2.6 KB0e0576f5647bupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tests/genui-mermaid-colors.spec.ts5.3 KBcb0c41022cf9upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tests/genui-mermaid-render-state.spec.tsx18 KB365b735b9cf4upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tests/genui-mermaid-safe.spec.ts9.5 KB3fa4170ab518upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tests/genui-panel.spec.tsx30 KB739a2b5eb09bupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tests/genui-partial-render.spec.ts13 KB1142d5686244upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tests/genui-partial.spec.tsx9.2 KBc1fbe2134ef6upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tests/genui-plot-lock.spec.tsx1.6 KB5434c2fd5797upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tests/genui-plot-pan.spec.tsx4.9 KBb1495ecbe157upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tests/genui-plot-redraw.spec.tsx2.3 KBa2e75d5ac777upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tests/genui-plot-view.spec.tsx1.7 KB626e53e199a7upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tests/genui-plot-wheel-lock.spec.tsx4.4 KB2a3bbdc810f1upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tests/genui-quiz-guard.spec.ts3.2 KBe0d1ee84d737upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tests/genui-root-shape.spec.ts11 KB7a73c32bd07fupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tests/genui-schema.spec.ts28 KBe3de79cb0656upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tests/genui-segmented-control.spec.tsx8.2 KB433a6cd1b0fbupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tests/genui-skill-examples.spec.ts2.5 KBf6937d1e8c94upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tests/genui-slider-precision.spec.tsx4.0 KB1bf2faa54447upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tests/genui-standalone-runtime.spec.tsx3.4 KBb43267f31b38upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tests/genui-standalone-theme.spec.ts4.5 KBe21c908d7513upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tests/genui-stat-decimal-comma.spec.tsx2.8 KB9cbb057298ccupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tests/genui-state-key.spec.tsx3.6 KB14b82623449dupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tests/genui-submit-members.spec.tsx26 KB2d6ce8942f65upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tests/genui-svg.spec.tsx5.6 KB5882ecb40b69upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tests/genui-table-column-name.spec.tsx4.0 KB181c48799c45upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tests/genui-table-external-links.spec.tsx8.3 KB1d2af1b3ecceupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tests/genui-table-filter-details.spec.tsx7.6 KBac3786880969upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tests/genui-table-multiline-cell.spec.tsx5.8 KBfec59dde58b6upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tests/genui-table-scroll.spec.tsx5.4 KB97c855646447upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tests/genui-table-smart-sort.spec.tsx9.1 KB8a9e86c7ec46upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tests/genui-table-wrap.spec.tsx5.5 KBe872721d5dfaupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tests/genui-tabs-active-index.spec.tsx1.4 KBcb220d811e39upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tests/genui-teach.spec.tsx4.8 KBddafb8ba0480upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tests/genui-tetris-table.spec.ts4.7 KB29fd4ca01e9bupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tests/genui-toolview.spec.tsx3.3 KBcb748b52e55aupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tests/genui-v11.spec.tsx4.7 KB62623e94252eupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tests/genui-v12.spec.tsx11 KBe9006c9aba25upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tests/genui-v25.spec.tsx11 KBf4f6a9afd3bbupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tests/genui-v26.spec.tsx11 KB851d5bbeb81aupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tests/genui-v27.spec.tsx9.7 KB3f568415eb16upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tests/genui-v28.spec.tsx8.8 KBac0f4147559aupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tests/genui-v29.spec.tsx29 KBd620782310d4upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tests/genui.spec.tsx8.5 KBa78144b5e2a7upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tests/helpers/standalone.ts4.1 KBdf041ec569f4upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tests/host-dependency-policy.spec.ts902 B9221ac5117bfupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tests/i18n.spec.tsx7.5 KBbae3981d942cupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tests/input-color.spec.tsx4.0 KB0553e6fd9cbaupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tests/input-durable-value-priority.spec.tsx1.8 KB46b680dd9ebeupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tests/install-script.spec.ts7.4 KBa12777ebc228upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tests/markdown-labels.tsx626 B75d81a656023upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tests/panel-append.spec.tsx8.6 KBdc2adcbe602eupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tests/panel-command.spec.ts6.0 KB3da213d788feupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tests/panel-computed-state.spec.tsx9.8 KB713ee06905dfupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tests/peer-range.spec.ts1.6 KB0e65de89d0ceupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tests/plot-loop.spec.tsx2.5 KBf35eaef711fdupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tests/plugin-genui.spec.ts21 KBb97394dcb660upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tests/plugin-tool.spec.ts30 KB0e670890773eupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tests/quiz-id-reset.spec.tsx2.3 KB3d69517d3663upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tests/safe-math-tokenizer.spec.ts3.1 KB8d454e7dacdcupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tests/scene3d-events.spec.tsx5.7 KBe8bb15bef628upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tests/session-resolver.spec.ts887 B88b49a95ecbdupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tests/setup.ts1.7 KBe268ed3f9869upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tests/sidechat-surface.spec.tsx14 KB99170b31e6bcupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tests/skill-md.spec.ts2.3 KB38e4a67e42abupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tests/source-fence.spec.ts6.2 KB2805bee002f2upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tests/streaming-shape.spec.ts3.5 KBd88a0c297556upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tests/submission-registry.spec.ts14 KB4ed82e24110fupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tests/svg-fence.spec.tsx1.9 KB86448ac55ae3upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tests/template-drawer.spec.tsx3.4 KBd8ac242d460cupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tests/templates.spec.ts2.0 KB5eb8516f9c05upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tests/textarea-durable-value-priority.spec.tsx3.4 KB1a49b37e3715upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • THIRD_PARTY_NOTICES.md8.4 KBc4a4090e541cupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tsconfig.json778 B71c30d65e5d2upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • tsdown.config.ts16 KB6f149d13bfdeupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • vitest.config.ts1.2 KBb37823139cd7upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

Plain-text copy, no login: /skill-bundles/omdsh-dev-dsh-genui.md

// REPO STATS

1.0k stars
6 open issues
Last commit: 2d ago