rea
morluto
Reverse engineer anything with agents, from app behavior down to native binaries.
PROJECT TOPICS
INSTALL REFERENCE
dsh plugin --profile web add github:qwq1999/dsh-panellist
该命令指向仓库当前默认分支;尚无绑定当前 commit 的完整验证结果。
PROJECT README
English | 简体中文
The management plugin for the Panellist in the DSH (DeepSeek Harness) client.
The Panellist is the column on the left of the session UI: the global entries contributed by individual plugins — plugins, automation tasks, skill center, memory system, SSH, MCP connectors… They come from different plugins, each declares its own order, and each decides its own icon and name.
This plugin lets the user take over: which Panel entries appear on the rail, in what order they appear, what they are called, what icon they use, and which entries are folded into a Group. All configuration is done in a new tab in Settings, and changes take effect immediately.
Status: implemented. This README pair is the whole specification — there is no separate design document: behaviour is §2–§3, the configuration and the interfaces are §4, the compatibility contract is §5, how to install it is §6, and how it is built is §7. The normative configuration shape is
docs/schema/config.schema.json.Three refinements to the original design (all discovered during implementation and backfilled into this document): the rail id of a Group is
dsh-panellist:<groupId>; unconfigured Panel entries are always listed on the rail, but anorderis written only once the Sequence is non-empty (i.e. after your first structural change); and the/panellist/api/revealendpoint was added to implement "Open config file".
| Settings → Panel list | A Group menu on the rail |
|---|---|
![]() |
![]() |
The DSH Panellist is a read-only projection: the shell enumerates the registrations in the sidebar.panellist slot and renders them sorted by the order each item reported at registration time. No official API is provided for rewriting someone else's registration:
order of its own item;label;So this plugin has to use two levers at the same time, and keep DOM intervention to a minimum:
The Sequence is a series of ordered items, each of which is either a single Panel entry or a Group:
The design conversation settled the notation this way (G{…} = one Group):
| Notation | Interpretation |
|---|---|
a c b d e |
[a][c][b][d][e] |
a b c |
[a][b][c] |
a dropdown(b c d e) |
[a][G{b,c,d,e}] |
a dropdown(b d e c) |
[a][G{b,d,e,c}] |
a dropdown(b e c)d |
[a][G{b,e,c}][d] |
dropdown(a b c)d e |
[G{a,b,c}][d][e] |
Three sources, and you can switch back to the original icon at any time:
** weight:viewBox="0 0 16 16",fill="none",stroke="currentColor"at **1px**, geometry on the 16 grid at half-step coordinates inside roughly 2…14, round caps and joins,aria-hidden, no ids and no external references. Three of them are the shipped artworks of the rail's own defaults, so a panel given one of them looks identical to the entry it replaces:puzzleis the plugin pinwheel (IconPluginPinwheelOutline),clockthe clock (IconClockOutline),morethe ellipsis (IconEllipsisOutline`). The set is checked mechanically at 16px next to those shipped artworks, and its ink extents are measured against them;script, foreignObject, event attributes, and external references (cases where href/xlink:href point outside);<img>), so it follows the theme's colors.The settings navigation row has its own dedicated glyph (a panel list, at the heavier Icon*OutlineMedium 1.3px weight that column is drawn at) — see §3.
main fallback (so selecting the Group id programmatically cannot error) but has no entry point of its own.createGroup anchors on the identity of the row above the topmost member), so it holds for any gesture.Enter/Space expands, Esc closes, and the up/down arrow keys move within the Group.Config changes take effect immediately: no need to restart DSH, no need to reload any plugin, and no need to reload the page. That holds for every edit, including the ones that write nothing at all: the rewrite pass compares a digest of everything the rail renders (order, name, icon, shown/hidden) and re-projects when it moves, so a second icon pick or a second rename lands on the rail just like the first one did.
The management panel lists the whole rail from the first time it is opened: there is nothing to "adopt" before you can touch a Panel entry, and there is no "not taken over yet" list. (An earlier design had a "not configured" list with per-item take-over / release buttons; it was removed on user feedback — it only added a step. A banner plus a "use the current rail order as a starting point" button went the same way: the list is the rail either way, so the gate is invisible.)
What still holds is the minimal-intervention property in what gets WRITTEN, not in the UI:
sequence is partially authoritative: it records only what you actually changed.sequence that is empty means no order is written at all (the state right after installation, a pure no-op), and an unconfigured Panel's name/icon/hidden state is left entirely alone; it keeps the contributor's own order.Implementation (src/shared/model.ts): rows is always the whole rail (an unconfigured row's order is null, meaning "do not write"), while reordering decides whether an order is written at all.
The shell may apply a client bundle more than once on one page (it re-evaluates a bundle whose file changed, an HMR pass re-applies it). Two controllers over one ledger fight: the second one captures the first one's glyph wrappers as if the contributors had installed them, and both write the same entries. apply therefore retires the previous mount before building its own (src/client/mount.ts), and every wrapper this plugin installs is recognisable, so an entry still holding one is unwrapped rather than adopted (§7.2).
The rail's last row, More, is not a Panellist registration: DSH renders it itself, from the sidebar.panellist.actions slot, and portals the menu it opens to document.body. So it is not a sidebar.panellist entry — no order, no label thunk, no glyph component for this plugin to rewrite (§7.2). It is listed in the sequence all the same, because it is an ordinary flex child of the same nav:
shell:more) takes a place in the sequence like any other and can be dragged or moved up and down. The rewrite pass writes the rail in DOM order, so its index says exactly how many rows precede it; the injected rule gives the More anchor order: 1 and every row from that position on order: 2, which parks it exactly there with flexbox. No other row selector is touched, and while the row is already last nothing is written at all.By design it cannot be renamed, re-iconed or grouped: its name, glyph and behaviour belong to the shell, and it has no page to open, so it can neither start a group nor be folded into one — its appearance editor says exactly that instead of offering the controls. One caveat: what moves is its painted position; keyboard order does not follow, so Tab still reaches it last, where the DOM puts it. (Every other row is different: their order is written into the registration itself, so the shell renders them in the new order and their tab order follows.)
Older shells are handled by measurement, not by a version check. Probe 5 (§5) reports what the rail actually contains, and only two of its answers mean "there is no row": a panel list holding nothing but rows, and a list whose non-row child no longer matches. In both cases the row is left out of the sequence, so an unsupported build shows no dead entry. If the profile already configures it — a stored position, or a saved Hide — the row stays listed and carries a Not painted here badge instead, because dropping it would hand that setting to orphan cleanup. A rail that is merely not mounted (collapsed sidebar) is unknown, not absent, and unknown keeps the row.
Adds one item to the left side of the Settings dialog:
面板列表); position: near the end of the settings navigation;Icon*OutlineMedium (1.3px) weight every other row in that column is drawn at, painted over the kernel's fallback gear as a currentColor mask. The settings navigation has no icon field in its contract, so the row is located by its visible text and marked; if that probe fails, the native gear stays (without reporting an error). See §7.5.Page content:
Shell row; only its position and its visibility are editable there (§2.12).Import validates the document before writing it; export serialises the whole file (all profiles). A failed import reports the field-level reason and changes nothing.
POST /panellist/api/reveal opens $DSH_HOME/panellist.json in the system file manager. The path is also printed next to the button.
Configured ids with no registration are collected here with a count, and "Clean up missing panels" removes them — after an explicit confirmation, never automatically.
The result of the four startup probes (§5) with a "Re-run self-check" button. A failed probe shows what it measured, what is therefore disabled, and the DSH version the plugin measured.
$DSH_HOME/panellist.json (permissions 0600, written as "temp file + atomic rename", falling back to a direct write when a Windows file lock conflicts);schemaVersion, and an older version is migrated as needed when read;{
"schemaVersion": 2,
"profiles": {
"desktop": {
"sequence": [
{ "type": "entry", "id": "plugins" },
{
"type": "group",
"id": "group:work",
"label": "更多",
"icon": { "kind": "original" },
"members": ["schedules", "skills", "memory"]
},
{ "type": "entry", "id": "ssh" }
],
"entries": {
"plugins": { "label": "插件市场", "icon": { "kind": "builtin", "name": "puzzle" } },
"mcp-connector": { "hidden": true }
},
"meta": { "updatedAt": "2026-10-10T03:00:00.000Z" }
}
}
}
The authoritative definition is docs/schema/config.schema.json (JSON Schema 2020-12; the host validates the whole document with ajv before every write and after every read, and tests/shared-schema.spec.ts runs this very example through it). sequence is a partial authority: the items it lists follow this order, and items it does not list are appended to the end by the program.
| Purpose | Identifier |
|---|---|
| Settings navigation tab | settings.section id = dsh-panellist |
| Group row (rail) | sidebar.panellist id = dsh-panellist:<groupId>, for example dsh-panellist:group:work |
Group page (main fallback, so selecting the Group id cannot error) |
main key = the same string |
| Host-half local route | /panellist/api |
Host-half routes (reachable only via local loopback, with a trusted-host fence):
| Method | Path | Purpose |
|---|---|---|
GET |
/panellist/api/config?profile=<id> |
Read the config for that profile |
PUT |
/panellist/api/config?profile=<id> |
Write the whole thing (server-side validation + atomic write to disk) |
POST |
/panellist/api/config/reset?profile=<id> |
Revert to defaults |
POST |
/panellist/api/reveal |
Reveal the config file in the system file manager (the "Open config file" button) |
GET |
/panellist/api/health |
Config storage and field-level self-check status |
?profile= only accepts ids that actually exist under $DSH_HOME/profiles/<id>; without the parameter, the config is written to the host's own profile (DSH_PROFILE, else default). /health and /reveal are whole-file level and ignore the parameter.
Export contracts of the two halves (consistent with the ecosystem):
name, inject, apply(ctx, config?)apply(ctx), injectdsh.bundle.patch (auto-mount) + dsh.client.{inject,platform}None of these is a public contract, so each one is measured at startup (§5) — but they are what the implementation assumes:
| Fact | Where it comes from |
|---|---|
sidebar.panellist is a list slot, declared by the sidebar entry's children table; registering into an undeclared slot throws |
the sidebar's own registration; the slot registry's register() |
A stored entry is a plain object ({component, options}), never frozen; entries/entriesOfSlot hand that object back |
the slot registry's register() |
A raw field write on a stored entry (including entry.component) is visible to the next projection, but bumps no ledger version and notifies nobody |
the registry + the batch notification channel |
register/dispose do mutate the ledger and notify subscribers — that is what the nudge (§7.2) rides on |
the registry's mutation channel |
The shell renders a row's text as resolveSlotLabel(options.label) ?? id, so a label-less registration already shows its id |
the sidebar's renderer |
The row glyph is rendered with {size, active}; size is 16 (18 when the rail is collapsed) |
the sidebar's renderSlot("sidebar.panellist", {size, active}) |
CSS-module class names are _<buildHash>_<stableKey>; an active row appends _panelActive, so [class*="_panelRow"] matches but [class$="_panelRow"] does not |
the sidebar's stylesheet |
The "More" row is a span.…_moreAnchor inside the same nav.…_panelList and the only non-button child in it; the menu it opens is portalled to document.body |
the sidebar's PanelMoreMenu + the primitives' Menu |
ctx.layout.panelInfo is a HostObservable<{activePanelId}>, and ctx.layout.selectPanel(id) throws for an id with no main entry |
the layout service's public reader |
The settings.section contract has no icon field; the shell picks the nav glyph from a closed list by section id (Icon*OutlineMedium at size 16) |
dsh-client-ui-settings-general's navIcon(id) |
Version floor: engines.dsh: ">=0.2.0-rc.2 <0.3.0-0" (matches the kernel version used for development; the type packages are available on npm at the same version, so contract drift is caught at compile time).
This plugin depends on five internal facts about DSH (none of them a public contract), so it self-checks each one at startup:
| Internal fact relied on | Consequence when it breaks | How it is probed (src/client/rail/probe.ts) |
Degradation |
|---|---|---|---|
The slot registration object is not frozen, so order/label/icon component can be rewritten afterwards |
Order, name, and icon cannot be changed | Temporarily register a probe row, rewrite its order, and read it back through entriesOfSlot; also check that neither the object nor its options is frozen |
Disable rewriting, read-only |
The DOM structure of a rail row can be located, and CSS supports the :has() selector |
The "hidden" state stops working | CSS.supports('selector(:has(*))'), plus counting rows with exactly the same selector as the hiding rule and comparing the count against the number of rail registrations (when the rail is not mounted, this counts as a pass with the reason stated) |
Disable hiding (keep the other rewriting), show a read-only notice |
| The shell still passes "is active" to the icon component (a hidden active Panel entry needs it) | A hidden active Panel entry cannot show its row temporarily | Temporarily register a probe row and wait two frames to confirm that its icon component really is rendered and that the active it receives is a boolean |
That rule fails: hiding becomes unconditional hiding |
| The settings navigation button can be located by visible text | The settings tab icon cannot be replaced | When the dialog is open, match this plugin's own row by text; when it is not open, this counts as a pass with a note (marking is re-run by a MutationObserver on every open) |
Keep the native gear icon |
The shell renders its own "More" row as the rail list's last non-button child, carrying a _moreAnchor class |
The "More" row keeps its native position and cannot be hidden | Match nav[class*="_panelList"] > span[class*="_moreAnchor"]; an unmounted rail, or a rail with no More row at all (nothing registers into sidebar.panellist.actions), counts as a pass and says which case it saw; any other non-button child is reported with its class name. The two "no row" answers are also what drops the row from the sequence, unless the profile already configures it (§2.12) |
Only that row loses its position and its Hide; on a build that paints no such row, an unconfigured row is not listed at all |
sidebar.panellist is declared by the sidebar entry's children table and this plugin can mount before it; registering a probe row then is refused, and that one refusal is what read-only keys off. The run waits on the shell's own "run this when the seat exists" seam (slots.inject) first, bounded at 5 s, so a boot-order race can never park the plugin in read-only. A shell that never declares the slot is reported honestly after the wait.[class*="_panelRow"], measured to work; [class$="_panelRow"] fails on the active row), and probing is repeated on every mount.dsh plugin --profile desktop add dsh-panellist
The package manifest declares the auto-mount layer, so there is no need to hand-edit the profile config.
# In the root of this repository
pnpm install
pnpm build
# Mount this repository into the desktop profile via link (DSH must be fully closed first)
dsh plugin --profile desktop add link:E:/ai-code-space/dsh-panellist
# Development loop
pnpm watch # tsdown --watch, rebuilds the browser half, hot-loaded by client HMR, no page refresh needed
Note: link: does not install this repository's own dependencies, so run pnpm install first; the desktop profile requires the app to be closed.
Rollback (taking the plugin out of the profile):
dsh plugin --profile desktop remove dsh-panellist
If the uninstall is not clean, edit ~/.dsh/profiles/desktop/package.json directly: delete dsh-panellist from dependencies and the same-named string from dsh.profile.bundles, then delete node_modules/dsh-panellist. The config file $DSH_HOME/panellist.json is the only external state, and deleting it restores the factory state.
Disabling or uninstalling the plugin leaves no residue: the order/label/component of registrations are restored, Group rows are released, the injected stylesheet is removed, and all marker attributes are cleared (dispose in src/client/registry/rail.tsx).
pnpm typecheck # tsc --noEmit
pnpm test # vitest run (jsdom)
pnpm build # tsc (declarations only) + tsdown (host half + browser half)
pnpm check # all of the above
Tests cover four areas: the model (normalization, serialization, migration, and corruption fallback for Sequence/Groups/overrides), the management panel interactions (drag and drop, move up/down, icon selection, SVG sanitization, import and export, member hiding), the degradation paths (read-only behavior after each of the four self-checks fails, including the boot-order wait), and the packaging contract (the manifest, the mount layer, one source of truth for the schema version and the route prefix). No E2E against the real DSH UI is introduced.
A tag publishes the package, and no machine holds a credential to do it: .github/workflows/release.yml authenticates with npm trusted publishing (OIDC) — GitHub mints an OIDC token for that run, the registry trades it for a short-lived publish token, and provenance is attached automatically, so there is no long-lived secret to leak or rotate. The loop is: bump version in package.json, pnpm check, git tag -a vX.Y.Z, git push origin main vX.Y.Z. CI checks the tag against package.json and calls npm publish (lib/ is not committed, so that step is also what produces the published files).
The one-time configuration (the trusted-publisher fields on npmjs.com), the post-release verification checklist, the failure table, and the manual fallback for when OIDC is unavailable are all in docs/RELEASING.md.
dsh-panellist/
├─ src/
│ ├─ index.ts # host half entry (re-exports plugin/index)
│ ├─ plugin/ # host half: config storage, local routes, migration and corruption fallback
│ │ ├─ index.ts # name / inject / apply
│ │ ├─ store.ts # file storage: ajv validation, 0600 atomic write, corruption isolation
│ │ └─ routes.ts # /panellist/api handlers (loopback fence, four endpoints + reveal)
│ ├─ shared/ # types and config model shared by the two halves (side-effect free)
│ │ ├─ config.ts # document shape, built-in icon names, id prefixes
│ │ ├─ model.ts # buildPlan: Sequence → what each row should write (pure function)
│ │ ├─ edit.ts # Sequence/Group edit operators (pure functions, keeping the "exactly once" invariant)
│ │ ├─ migrate.ts # schemaVersion migration framework
│ │ ├─ validate.ts # lenient reading on the browser half
│ │ └─ protocol.ts # route paths and cross-half JSON shapes
│ └─ client/ # browser half
│ ├─ index.tsx # apply(ctx): assembly order, styles, self-checks, language
│ ├─ controller.ts # the single loop of config → plan → rewrite / Group rows
│ ├─ contracts.ts # frozen interfaces between units
│ ├─ ctx.ts # type augmentation only: ctx.slots / ctx.layout / slot declarations
│ ├─ styles.ts # the single injected stylesheet (aggregates each unit's CSS block by id)
│ ├─ mount.ts # one live mount per page: a second apply retires the previous one
│ ├─ service.ts # fault-tolerant reading of optional cordis services
│ ├─ config/store.ts # config state: optimistic apply, rollback on failure, import/export
│ ├─ i18n/index.ts # Chinese and English entries (the key set is closed)
│ ├─ registry/rail.tsx # registry discovery + rewrite + sync nudge + our own rows
│ ├─ rail/css.ts # the DOM rules (hiding, settings-nav mask) in one place
│ ├─ rail/probe.ts # the four self-checks and the degradation decision
│ ├─ groups/ # Group trigger rows, capture-phase click interception, menu, group page
│ ├─ settings/ # settings tab: sequence editing, appearance overrides, config, self-checks
│ └─ icons/ # 24 built-in glyphs + the settings-nav glyph + SVG allow-list sanitization
├─ docs/ # documentation assets
│ ├─ images/ # README screenshots
│ ├─ RELEASING.md # the release runbook (tag → CI)
│ └─ schema/config.schema.json # normative config shape (read by the host at runtime)
├─ tests/ # 21 specs (model, host half, rewriting, mount guard, probe, groups, settings, icons, copy consistency, packaging contract)
├─ cordis.patch.yml # auto-mount layer
├─ .github/workflows/release.yml # a tag publishes (npm trusted publishing / OIDC)
├─ README.md # English (this file)
└─ README.zh-CN.md # Chinese
registry/rail.tsx reads the rail slot, captures each entry's original order/label/component the first time it sees it, and writes only what differs. Three consequences are worth knowing:
CASCADE_LIMIT passes and logs a warning.order/label. An edit that changes only what our own wrapper paints (a second built-in icon on a panel that already has one, a rename resolved by the already-installed thunk) writes no field at all — so the pass also compares a digest of everything the rail renders (order, label, icon, hidden, suppressed; panels and groups) and nudges when it moves, even with nothing to write. The first pass of a mount only remembers the digest, so a fresh install stays a strict no-op.entry.component back can pick up our own wrapper. Every wrapper is registered in a page-global WeakMap (wrapper → getter for the captured component); the capture pass unwraps what it finds and claims the slot, and nativeGlyph unwraps its answer. Without that, the settings previews of hidden panels and group members showed an empty box.One stylesheet, injected once and adopted by a document id so a re-evaluated bundle cannot produce a second copy. Hiding is a single :has() rule over nav[class*="_panelList"] > button[class*="_panelRow"] — a row whose glyph rendered a marker span disappears. Because the marker is rendered by React, the rule is declarative: no observer, no re-parenting, no layout thrash. hidden = "hide unless this row is the active panel"; suppressed = "always hide, it is shown inside a Group instead". A second, equally declarative rule places the shell's own More row (§2.12): the anchor takes order: 1 and the rows that must follow it order: 2, so the flex container paints it at the sequence position the user chose without moving a single node; the rule is only emitted while there is something to move.
A Group row is a genuine registration of ours into sidebar.panellist, with its own main page under the same key: the shell places it by order, renders its label, and reuses both as the accessible name and the collapsed tooltip. sync() is idempotent — it re-registers only rows whose order or resolved label actually changed, because a needless re-registration would remount a row the user may be interacting with.
The row is a single <button> owned by the shell, so the trigger glyph installs capture-phase click/keydown listeners on its ancestor button: capture runs before React's delegated handler at the root, so one stopPropagation() keeps the shell's own selectPanel from ever running, and preventDefault() cancels the row's default activation. The menu itself is a body-portal overlay positioned from the row's getBoundingClientRect(), so it can escape the sidebar's overflow; it is measured before being shown, and it closes on Esc or an outside click.
The Group highlight comes from the layout's own public reader (ctx.layout.panelInfo), not from the shell's aria-current: the shell highlights a row only when the row is the active panel, and a Group row never is, so membership drives the highlight instead.
The settings.section contract has no icon field and the shell picks the nav glyph from a closed list by section id, so the row is located by its visible text: a MutationObserver on document.body matches [role="dialog"] nav button against our own localized label and stamps data-dsh-panellist-settings-nav, and the stylesheet hides the shell's own <svg> in that row and paints our masked glyph in front of it. All of it is removed on dispose, and if nothing matches, the native gear stays and the failure is reported through the self-check — never an error.
First version includes: Sequence editing (drag and drop + keyboard fallback), Groups, Shown/Hidden (including inside a Group), Label and Icon override (original icon / built-in icon set / paste SVG), config import/export, Orphan retention and cleanup, a Chinese and English UI, self-checks and read-only degradation, and this bilingual README pair.
Not in the first version (left for a later one): search within a Group, a right-click context menu on the rail, per-language names, and E2E against the real DSH UI.
Non-goals: managing the right-column card tabs; managing the tab order of the Settings dialog itself; changing the content of any plugin page; replacing the DSH built-in Panellist.
pnpm check is green (21 specs / 325 cases, §6); the code is on GitHub and tagged v0.1.0, published to npm (dsh-panellist), and submitted to awesome-dsh-plugin.The mount layer can be verified offline: point the CLI at any non-desktop profile with this repository's patch layered on top.
# Create a throwaway profile (derived from the shipped web template), layer this
# repository's mount patch onto it, and print the composed tree only.
dsh panellist-dryrun --from-default-profile web \
--patch E:/ai-code-space/dsh-panellist/cordis.patch.yml --dump-config
The composed tree contains (measured on this machine):
# == E:/ai-code-space/dsh-panellist/cordis.patch.yml
- id: panellist
name: dsh-panellist
Nothing is served and nothing is installed; delete $DSH_HOME/profiles/panellist-dryrun afterwards. desktop itself is managed exclusively by the Electron application and the CLI refuses it outright — deliberate, and the reason this recipe uses a throwaway profile. tests/manifest.spec.ts turns the consistency invariants (package name = the plugin's name export = the patch's name, every runtime-read file listed in files, one source of truth for the schema version and the route prefix) into cases that run on every pnpm check.
MIT
CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: deepseek-harness。