npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@qzsy/dsh-command-palette

v1.5.0

Published

Command+K palette for recent sessions, workspaces, files, and actions with pinyin search and live session status.

Readme

@qzsy/dsh-command-palette

Packaged from the local DSH plugin dsh-command-palette; published under the @qzsy scope.

Install

dsh plugin add @qzsy/dsh-command-palette

Upstream README

Command Palette for DSH

A persistent DeepSeek Harness Client plugin that turns Command+K into a command palette for the Web/Desktop GUI: recent sessions with live status, workspaces, files, and actions — searchable in Chinese, English, full pinyin, pinyin initials, or any mixed form.

What it does

  • Command+K on the Desktop app opens a floating palette; the same chord toggles it closed. In the browser profile it adopts the browser-safe chord that session.search used before (Mod+Alt+K on macOS).
  • Sections and filters: All / Sessions / Workspaces / Files / Actions.
    • Sessions: every non-blank, non-archived Session ordered by updatedAt, with its Workspace label, a compact relative age, and a live status badge: 工作中 (pulsing blue dot), 待批准 / 待审阅 / 待回答 (amber), 出错 (red, failed run), or 已完成 (green, unread completion). A success that has already been viewed shows no badge. The section label counts Sessions by state, e.g. 近期会话 · 2 个进行中 · 1 个出错 · 3 个未读 (only nonzero segments), and updates live while the palette stays open. When the Git badge bundle is installed, the Workspace name under each thread title also carries that Workspace's +N −M / 干净 / 无 Git badge. Choosing a Session also reveals it in the left Workspace sidebar: a folded Workspace (and every folded Workspace Tree ancestor) expands, the Session row watermark rises, the group smooth-scrolls into view, and the Workspace header flashes.
    • Sub-agent threads are hidden by default. Sessions whose origin === "subagent" are excluded from rows, search results, workspace activity badges and counts. When any exist, the footer shows 显示 N 个子代理会话; the toggle includes them for the current palette session and returns to the hidden default on the next open, so teammate and research threads never crowd the list unless asked for.
    • Workspaces: Workspaces ordered by their most recent Session activity, with an abbreviated path and an aggregate status badge that reports one state by priority pending > failed > running > unread (N 个待处理 / N 个出错 / N 个工作中 / N 个未读). When the @qzsy/dsh-git-badge bundle is installed, each workspace name also carries its Git badge: +N −M line changes, 干净 for a clean repository, 无 Git outside a repository, or the file count when only untracked files changed. Git data comes from the Host's POST /api/git-badge route (8 s palette cache); without that route the badges are simply absent. Enter opens the newest Session in the Workspace, or a fresh blank Session when it has none.
    • Files: live, debounced Host file-reference lookup scoped to the Session in the main panel; choosing a row opens the file in the right-hand preview. Every file row carries a 项目 · <Workspace> badge below its path so the search scope stays visible, and the Files placeholder names the same project. Opened files are remembered locally (origin-scoped localStorage) and listed as Recent files when the search box is empty; recent files resolve their project from the Session's Workspace. File matching stays Host-ranked path matching (see limitations).
    • Actions: every registered shortcut command (labels and keys come from the live shortcut catalog, so plugin commands appear automatically). Enter invokes the command through the shortcut registry; Settings and the keyboard shortcut reference open from here.
  • Mixed Chinese/English search through text-search-engine: one query covers Han characters (登录), full pinyin (denglu), pinyin initials (dl), English subsequences (nextjs), space-separated terms, and mixed forms (qunxingerp, 群erp, qxkf). Matched ranges are highlighted in titles and subtitles. Ranking prefers tighter, earlier title hits, then detail hits, then recency.
  • Keyboard: Up/Down move the selection, Enter opens, Escape closes. The filter switches with bare ← / → (both directions, wrapping) or Tab / Shift+Tab; holding Alt/Ctrl/Cmd with an arrow keeps native caret or word movement inside the query. IME composition is never intercepted, so pinyin candidate selection keeps working. Focus returns to whatever had it before opening.
  • Mobile: at (max-width: 720px), (pointer: coarse) and (max-width: 1024px) the palette becomes a bottom sheet at 90% of the layer height. It opens without focusing the search input, so the soft keyboard stays closed until the user taps the field. All keyboard hints (Esc key, row shortcuts, footer key legend) are hidden; the footer only remains for the subagent toggle.
  • Unread count: the sidebar row shows the number of Sessions that finished successfully but have not been viewed (the green 已完成 badge; failed, archived, blank and subagent Sessions are excluded). The collapsed rail shows a dot instead. The always-mounted overlay computes the count and mirrors it into a plugin-local store read by the sidebar glyph.
  • Sidebar entry: the 命令面板 / Command palette row joins the global panel stack directly below 自动化任务 / Automations (glyph-only in the collapsed rail). Choosing it opens the overlay without switching the main panel: the row is an action, so the plugin answers that one panel id in the layout selection and delegates every other id to the layout owner.
  • Light/dark themes follow --dsw-* tokens; all copy is registered in the Client locale service (zh/en).

Search engine integration

DSH's browser module table only resolves its own platform modules and client-plugin rows, so a plain-JS plugin cannot require('text-search-engine') at runtime. The package's minified browser IIFE is therefore vendored and injected into the client bundle:

  • vendor/text-search-engine.min.js — exact browser build from the pinned [email protected] dependency (MIT; license in vendor/text-search-engine.LICENSE).
  • scripts/sync-vendor-engine.mjs — rewrites the marked region in client.js from the vendored file; run node scripts/sync-vendor-engine.mjs after updating the vendored build.
  • client.js — the generated region captures the engine exports in a factory scope constant and uses createSearcher() with title/detail fields, custom ranking, and hit ranges for highlighting. If the engine fails to initialize, a built-in subsequence matcher keeps the palette usable.

File search is delegated to the Host (ctx.remote.fileReferences.list), which retrieves and ranks paths from the current Session workspace; pinyin is applied to sessions, workspaces, and actions, where titles are user-facing Chinese text.

Session status

The palette reads the root useSessionStatus hook of the shell.overlay slot (provided by dsh-client-ui-session). That observable snapshot carries running, pendingInteraction.kind, and completionUnread per Session, so badges and counts change live as agents start, wait for input, and finish.

A Session settles into one of three terminal states:

  • Viewed success — no badge. The completion has been acknowledged, so the row is a plain Session and the badge clears.
  • Unread success — green 已完成. Shown while the snapshot still reports completionUnread; the tooltip reads 已完成,尚未查看.
  • Failed run — red 出错. The tooltip reads 运行出错:<message>, or 运行出错(尚未查看):<message> when the same Session is also an unread completion. An empty failure message falls back to 未知错误.

The unified snapshot answers whether a run is going, waiting, or finished unread; it does not say why a run ended. Failures therefore come from the forwarded Host event api-session/error, which carries Agent failures — including network and provider errors. The palette keeps the latest message per Session and drops it when the next turn starts (api-session/status with running true), when a new user prompt arrives (api-session/activity), or when the Session is removed (api-session/removed). Aborted runs and transient tool errors never reach that event, so they never raise the badge.

The map is in-memory for the app session — the same lifetime as unread completions — so a reload starts clean. A failure that predates the palette stays clear until the Host forwards a new api-session/error.

When several states apply, one badge wins in this order: pending interaction > running > failure > unread completion. A stale failure can therefore never mask a Session that is working or waiting for the user.

Workspace badges aggregate their Sessions with the priority pending > failed > running > unread, counting each Session once (N 个待处理 / N 个出错 / N 个工作中 / N 个未读). The Sessions group label appends the counts in running/pending/error/unread order, keeping only nonzero segments: 近期会话 · N 个进行中 · N 个待处理 · N 个出错 · N 个未读.

Error excerpts are whitespace-collapsed onto one line and capped at 180 characters with an ellipsis.

scripts/verify-status.mjs is the browser-free node harness that verifies this state matrix. docs/palette-statuses.png renders the five states above from the same component (running, pending, failed, unread, viewed).

Sidebar reveal

Selecting a Session or Workspace closes the palette, navigates, and then reveals the target in the left Workspace browser. The browser owns reveal for its own search in private React state, so the palette drives the stable DOM markers the browser publishes instead: data-row-key identifies Workspace / Session / watermark rows, aria-expanded reports a folded Workspace, and role="tree" is the scrolling list. The persisted dsh.workspace.view.v5 store supplies the grouping mode, which distinguishes sibling Workspace groups from Workspace Tree ancestry.

The reveal is bounded (about 2.4 s of retries): it expands the owning group and its tree ancestors, raises hidden session rows through the same Show more control the browser owns, then scrolls the group and chosen row into view with behavior: "smooth" (or auto under reduced motion) and briefly rings the Workspace header with a --dsw-* token outline. If the sidebar is a collapsed rail, or the target is hidden by the current archive filter, the reveal is a silent no-op — navigation still succeeds.

Marketplace palette

The DSH Market landing page in this repository (apps/market) mounts the same keyboard-first interaction as a live demo: ⌘K / Ctrl+K searches the plugin directory, opens plugin pages, and offers the install command. The palette footer credits this package, and @qzsy packages stay pinned ahead of upstream duplicates so the command palette itself is always one keystroke away.

Shortcut ownership

session.search already owns Command+K in the shipped UI. The palette registers with the free Command+Shift+P default and, once per device preference document, uses the public ctx.shortcuts.edit() API to:

  1. clear session.search's binding, and
  2. bind palette.open to the chord session.search had (Command+K on Desktop, Mod+Alt+K in the browser).

That is a normal, visible override in Settings → Keyboard shortcuts: both rows show as modified, and Restore All Defaults restores the palette to Command+Shift+P and search to Command+K. On the next launch the plugin re-adopts the chord while both rows are still at their unmodified defaults, so Command+K keeps opening the palette. Session search itself stays available from the palette's Actions list and from the sidebar search icon.

Install

The bundle is installed into the current profile with plugin_manager install_bundle (absolute package directory). It needs no build step at install time: client.js is a plain-JS __ModuleLoader__ module that only requires react from the browser module table, with the vendored engine already inlined.

Files

  • package.json — bundle manifest (dsh.bundle.patch, dsh.client, display resources)
  • cordis.patch.yml — inserts the Host row
  • index.js — Host half (no-op; the palette is client-only)
  • client.js — shortcut adoption, overlay palette, live status badges, ranked mixed-script search, sidebar trigger, zh/en dictionaries
  • vendor/ — vendored engine build and its MIT license
  • scripts/sync-vendor-engine.mjs — regenerates the vendored engine region
  • locale/en.json, locale/zh.json — Plugin Manager title/description
  • icon.svg — original artwork
  • docs/ — verification screenshots