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-paste-file

v1.1.0

Published

Mac paste-file for the DSH composer: images attach as draft images; files and folders insert their original path (read from the OS clipboard) as a localized [文件]/[文件夹] or [File]/[Folder] line at the front of the message.

Readme

dsh-paste-file

Mac paste-file for the DSH composer. Paste a local file or folder into the composer input box and it is inserted as a path line at the front of the message — no copy of the content is sent, only the on-disk path.

What it does

  • Images paste normally: they attach as draft images (built-in composer behavior).

  • Files / folders show a full-bleed tile in the in-card attachment rail (so the composer grows like a pasted image), then on send (button or Enter) the placeholder tile is removed and a localized path line is prepended before your text:

    [文件] /path/to/file.py /path/to/other.md
    [文件夹] /path/to/a/folder

    In an English harness the labels become [File] / [Folder]. The active language follows the DSH harness locale and defaults to Chinese when the locale is unknown.

  • File placement (host side):

    • Non-protected files → hard-linked into the paste dir (no copy).
    • Small files (≤ 5 MB) from protected dirs (Downloads/Desktop/Documents) → copied (hard links share the inode and still trip the whole-directory TCC prompt).
    • Large files → hard-linked only.
    • Folders → referenced by their original path (folders cannot be hard-linked and copying a tree is too heavy).

Scope

This plugin only inserts files into the input box. It does not read or process file content. How the model reads a pasted file (text, PDF, audio, video, …) is left to the model and your own tools.

Package layout

This is a DSH bundle: it ships a cordis.patch.yml (declared by dsh.bundle.patch) that mounts the paste-file plugin row, plus the host half (lib/index.js) and client half (lib/client.js). Adding the package to a profile's dsh.profile.bundles mounts it.

How the halves talk (no build step)

Both halves are self-contained and run on the bundle runtime, so there is no compile step — the browser client is served verbatim by the host's client-modules route.

  • The host half is a normal Cordis plugin (no harness). It exposes its file operations as a Cordis pasteFile Service and registers them as Typert Remote invocations via ctx.typert.register(...).
  • The client half is a classic <script> registered through window.__ModuleLoader__.load(...). It mounts the same Remote descriptors via ctx.remote.$mount(...) and calls the Host through ctx.remote.pasteFile.* — the only client→host RPC channel bundle plugins have. It gets React via require("react").

Because the bundle runtime provides no host/harness globals (those are dynamic-plugin-only), all file access goes through the Typert Remote channel.

Formal deployment

The client is self-contained, so no frontend rebuild and no DSH source checkout are required — a plain npm install of the published package is enough.

1. Publish the package

cd dsh-paste-file
npm publish

2. Add the plugin to the web profile

dsh plugin --profile web add dsh-paste-file

This installs the package into the profile's node_modules and appends dsh-paste-file to dsh.profile.bundles. (Requires pnpm on PATH.)

3. Configure the paste dir (optional)

dir defaults to the DSH process's working directory + /.pasted — the workspace the model can read — so no configuration is needed. Override it only to place pasted files elsewhere, in the profile's cordis.patch.yml ($DSH_HOME/profiles/web/cordis.patch.yml):

- insert:
    - id: paste-file
      name: 'dsh-paste-file'
      config:
        dir: '/path/to/workspace/.pasted'

4. Boot

dsh web

The plugin is now persistent — it auto-loads on every boot, no reinstall.

Configuration

The host half accepts a Cordis plugin config:

| key | type | default | meaning | |-------------|--------|------------------------------------------------|-------------------------------------------| | dir | string | <workspace>/.pasted (auto) | where pasted files are hard-linked/copied | | protected | array | ['~/Downloads', '~/Desktop', '~/Documents'] | TCC-protected dirs whose small files copy |

Requirements

  • macOS (reads the clipboard file URL via osascript).
  • The DSH host provides the typert service; the client provides conversation, sessions, slots, timer, locale, and remote. The host half needs no shell service — all file operations (osascript, hard-link/copy) run directly on the built-in node:fs / node:child_process modules of the bundle host.

License

MIT