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

dsh-addtochat

v0.1.0

Published

DSH web plugin: select text in a conversation reply and add it to the composer input as a fenced code block — one button replaces select-copy-paste. Zero-hack: browser Selection API + the official inputActions.setDraft face; no persistence, no overlays, n

Readme

dsh-addtochat

Select text inside a conversation reply and add it to the composer input as a fenced code block — one button replaces select → copy → paste.

![interaction: select a reply → floating button "添加到会话" / "add to chat" appears above the selection → click → the selection is appended to the main input as a ``` block → type your question → Enter]

What it does

  1. Select any text inside a conversation message (not streaming).
  2. A small floating button appears above the selection:
    • Chinese UI: 添加到会话
    • anything else: add to chat
  3. Click it: the selected text lands in the main composer wrapped in a fenced code block (``` on its own lines), followed by a blank line — anything you already typed stays above it, and your next keystroke starts right below the fence.
  4. Type your question and hit Enter — the block rides along with your normal submission.

That is the whole feature. No badges, no bubbles, no persistence, no reply tracking. The plugin does exactly what the button says: moves the selected text into your input so you can ask about it.

Zero-hack contract

  • Selection capture: browser-native selectionchange / getSelection().
  • Composer write: the OFFICIAL inputActions.setDraft face that ui-conversation injects into conversation.input.dock slot entries (standard-props), bridged to the plugin's own overlay host.
  • No renderer replacement, no session.prompt monkey-patching, no composer DOM interception, no localStorage, no sending logic — the plugin never submits anything; your Enter does.

Install

dsh plugin --profile web add dsh-addtochat

or, from a local checkout, link it into the profile package:

"dependencies": { "dsh-addtochat": "link:/path/to/dsh-addtochat" },
"dsh": { "profile": { "bundles": [ ..., "dsh-addtochat" ] } }

then restart the web app.

Build & test

pnpm install
pnpm test     # unit tests (pure text/layout helpers)
pnpm build    # host ESM + browser client bundle (lib/)

Layout

  • src/index.ts — host half (placeholder).
  • src/client/index.tsx — apply(): selection controller, overlay host, floating button, conversation.input.dock slot entry.
  • src/client/selection.ts — selection capture + validation.
  • src/client/format.ts — pure helpers (block building, draft append, label, button placement).
  • src/client/bridge.ts — dock-slot → overlay bridge for the official composer faces.

MIT