dsh-region-probe: Enabling Agents to Read What the Harness Interface Actually Renders

Preface

When developing clients or plugins in DeepSeek Harness (DSH), UI bugs often manifest as “blank areas, fleeting errors, or misaligned layouts.” Agents typically cannot take screenshots, and humans may not always be watching the screen, so logs alone are hard to align with “which regions the shell actually drew, how big each one is, and roughly what text is inside.”

A common approach is to manually describe the interface or rely on fixed selectors and CSS class names to guess DOM structure. DSH shells use stable data-slot anchors for regions, but class names are CSS Module hashes that change with each build, making maintaining a region list unrealistic. Below is the community plugin dsh-region-probe (maintainer: orphiczhou, category: client): it reads Cordis Inspect to aggregate region lists, geometry, and occupancy in a running Harness page, and records history of regions that previously failed and then recovered, allowing agents to self-verify rendering results via existing inspection tools.

What This Is

dsh-region-probe is a read-only Cordis Inspect provider for DSH. It has no own UI, exposes no extra tools, and makes no network requests; it registers a provider on the client side, providing three read-only methods.

The Harness shell renders each UI region as an anchor with a stable slot key, for example:

<div data-slot="sidebar.workspaces">…content rendered by the occupant…</div>
<div data-slot-error="tool.view.demo">…when this occupant fails to render…</div>

The anchor itself has display: contents and occupies no layout box; the provider reads these anchors, so there is no need to maintain a region list, per-region code, or depend on the shell’s CSS class names. Regions added by third-party plugins and future versions can be seen as long as the corresponding anchors appear in the DOM.

After installing and reloading the Harness page once, cordis_inspect_list will list a provider named Regions under the client platform.

What the Agent Can Ask

Call the following methods via the agent’s existing Cordis Inspect queries (platform: "client", provider: "Regions"):

Method Purpose
outline() All regions in the current DOM: slot, failed, failedBefore, empty, anchors, nodes, screen boxes (x,y,width,height), text samples; summarizes total, failed, failedEver.
snapshot({ slot \| selector, depth?, limit? }) A bounded node list for a single region: path, tag, role, aria-label, owning slot, text, geometry, visible, fontSize, color, background. Prefers slot keys but also accepts any CSS selector. depth defaults to 3, capped at 8; limit defaults to 60 nodes, capped at 300.
failures() This page’s render failure history: which slots failed, how many times, and whether they are still failing (active / recovered / firstSeenAgoMs / lastSeenAgoMs).

Invocation example in the README (outline):

// cordis_inspect_query({ platform: "client", provider: "Regions", method: "outline" })
{
  "total": 36, "failed": 0, "failedEver": 1,
  "regions": [
    { "slot": "sidebar",        "nodes": 137, "x": 0,   "y": 0, "width": 280,  "height": 900, … },
    { "slot": "main",           "nodes": 110, "x": 280, "y": 0, "width": 1160, "height": 900, … },
    { "slot": "sidebar.workspaces", "nodes": 49, "x": 12, "y": 204, "width": 268, "height": 640,
      "failed": false, "failedBefore": true, "empty": false,
      "text": "Session Tree + ⋯ ▶ xiaomi-power-key-proj …" }
  ]
}

If the same slot key is rendered multiple times (e.g., one copy in the expanded sidebar track and another in the collapsed track), they are merged into one region with anchors: 2 and a union bounding box.

Why Failure History Is Tracked Separately

outline() only reflects whether a region is failing at this moment; regions that briefly errored and then recovered can easily be missed in a single snapshot. The provider maintains a bounded ledger (200 entries) within the page’s lifecycle:

  1. Starts with the plugin via immediately: true, recording from page load onward;
  2. Uses a MutationObserver on childList and syncs again before each response, ensuring the ledger stays correct even if the Observer is unavailable;
  3. Slots that have recovered are marked recovered: true and retained; if the same slot fails again, count increments.

Failure reasons are not captured in this provider: the shell only leaves an empty data-slot-error marker, and specific errors appear in the page console.

What It Can and Cannot See

  • All regions appearing in the current DOM (including regions from other plugins and future DSH versions), no opt-in required.
  • Traverses shadow roots and same-origin iframes, marking #shadow and #frame in node paths.
  • Distinguishes “declared but not rendered” (empty: true), “render failed” (failed: true), and “no match at all”; an empty list distinguishes causes such as “no regions”, “render-error”, “selector no match”, “invalid-selector”.
  • Content inside cross-origin iframes and drawn on canvas is unreadable; it reports the host element instead of pretending to read the inside.
  • data-slot / data-slot-error are rendering implementation details, not an external contract; if the shell stops outputting them in the future, outline() may be empty, but you can switch to snapshot({ selector }) which does not depend on slots.
  • With multiple windows, which page answers is decided by the Harness host broadcasting the inspect request (the first valid response is taken), and the geometry data corresponds to the answering page, not chosen by this plugin itself.

Installation & Activation

DSH installs plugins via profile bundles: pure ESM, no build step, no npm dependencies.

Graphical interface: Plugins page → Add plugin → paste:

https://github.com/orphiczhou/dsh-region-probe

Command line:

dsh plugin add orphiczhou/dsh-region-probe

Local directories can also be added as specs in the same dialog. The client half loads with the page; after installation, simply reload the Harness page once.

Typical Usage Patterns

  1. After the agent modifies client or plugin code, call outline() to verify that failed, empty, and each region’s text and geometry are reasonable.
  2. Call snapshot({ slot: "sidebar.workspaces", depth: 3, limit: 60 }) for suspicious slots to view visible nodes and styles without relying on screenshots.
  3. If the user describes “it flashed red earlier but then was fine”, call failures() to check failedBefore, recovered, and count.

The plugin does not declare peerDependencies; it integrates via optional injection of cordisInspect; in combinations without a client runner, it silently fails to load rather than breaking the whole package.

Use Cases & Notes

Suitable for: Agents or developers building shells, plugins, or tool views in DSH who need read-only UI self-inspection in a real running page to locate regions that failed to render or had transient failures.

Permissions & security: The plugin runs with the permissions of the current DSH client process and can read region names, visible text, computed styles, and geometry; it does not click, write to storage, access cookies or localStorage, or make network requests; responses are bounded by node count, depth, text length, etc. The README positions it as a development self-inspection tool—if you do not want a session to read its own interface, disable this plugin. Before installing, review the GitHub source code and the MIT license yourself.

The community plugin directory entry on SkillHub and the GitHub repository are independently maintained and are not officially affiliated with DeepSeek / High-Flyer; the DSH ecosystem emphasizes “everything is a plugin”, and this article introduces a community-contributed client inspect provider.

Conclusion

dsh-region-probe turns the Harness shell’s slot anchors into a structured, queryable read-only view, and adds a ledger of transient failure history, letting agents verify “what the interface actually rendered” without taking screenshots or maintaining region lists. For more information and installation:

  • Directory page: https://www.skillhub.cn/plugins/orphiczhou/dsh-region-probe
  • Repository: https://github.com/orphiczhou/dsh-region-probe
羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye