<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Node.js on Trevor's Blog</title><link>https://hitrevor.com/en/tags/node.js/</link><description>Recent content in Node.js on Trevor's Blog</description><generator>Hugo</generator><language>en-US</language><lastBuildDate>Tue, 17 Nov 2026 08:11:07 +0800</lastBuildDate><atom:link href="https://hitrevor.com/en/tags/node.js/index.xml" rel="self" type="application/rss+xml"/><item><title>DeepSeek Harness: One of My Plugins Can No Longer Be Reinstalled</title><link>https://hitrevor.com/en/posts/dsh-plugin-source/</link><pubDate>Tue, 17 Nov 2026 08:11:07 +0800</pubDate><guid>https://hitrevor.com/en/posts/dsh-plugin-source/</guid><description>I ran dsh plugin &amp;ndash;profile web list and it printed one number: 8 packages. Eight dependencies, four of them third-party plugins I installed myself, the other four are the official bundles. It looked tidy, until I went to check how their versions were declared.</description><content:encoded><![CDATA[<p>I ran <code>dsh plugin --profile web list</code> and it printed one number: 8 packages. Eight dependencies, four of them third-party plugins I installed myself, the other four are the official bundles. It looked tidy, until I went to check how their versions were declared.</p>
<p>Four notations, four sets of logic. And one of them, as of today, I can no longer reinstall.</p>
<h2 id="the-four-lines-i-saw-first">The four lines I saw first</h2>
<p>In the profile&rsquo;s <code>package.json</code>, these four plugins declare their dependencies in four different forms: one plain version number, another plain version number, one GitHub URL pinned to a forty-character sha, and one local tarball pointing under <code>/tmp</code>.</p>
<p><img alt="Four source notations side by side" loading="lazy" src="/images/dsh-plugin-source/fig1.png"></p>
<p>Line one is the version <code>1.8.0</code>, line two is also a version, <code>0.1.1</code>, line three is <code>github:LanFeng97/dsh-workspace-create-dialog#7c4d0ef...</code>, and line four is <code>file:/tmp/dsh-plugin-build/dsh-plugin-profile-ping-0.1.0.tgz</code>.</p>
<p>The official docs call all of these &ldquo;installing a plugin&rdquo;: whatever you put after <code>dsh plugin add</code> gets installed. At install time there is no difference. After install, the difference shows up entirely in upgrading and reinstalling.</p>
<h2 id="a-version-number-is-the-least-trouble">A version number is the least trouble</h2>
<p><code>dsh-plugin-sticky-wall</code> and <code>dsh-plugin-ark-image-gen</code> use ordinary npm dependencies with a version number. The first is 1.8.0, the second is 0.1.1.</p>
<p>The advantage of this form is that it can be checked: according to the output of <code>npm view dsh-plugin-sticky-wall versions</code>, five versions are listed, <code>0.0.0-stage</code>, <code>1.4.0</code>, <code>1.7.0</code>, <code>1.7.1</code>, <code>1.8.0</code>, and <code>latest</code> is exactly 1.8.0. So what I have is the newest one, nothing behind.</p>
<p>The cost is that the moment the author changes something, you follow. <code>latest</code> moves one step forward, and the next <code>pnpm update</code> or profile reinstall hands you the new version, with no intermediate rung to pick.</p>
<h2 id="the-sha-pinned-one-freezes-very-cleanly">The sha-pinned one freezes very cleanly</h2>
<p><code>dsh-workspace-create-dialog</code> was installed straight from GitHub, with a forty-character sha hanging off the end.</p>
<p>This notation locks the version to that one commit. Whatever the author changed afterward, how many times they refactored, which dependencies they added, none of it concerns you: every reinstall gives you exactly the same thing. To upgrade, you go find the new sha yourself, edit <code>package.json</code>, and install again.</p>
<p>I went ahead and checked whether this sha is the current latest. The default branch of the repo <code>LanFeng97/dsh-workspace-create-dialog</code> is <code>main</code>, and the last push was on 2026-10-13.</p>
<p>The first item returned by <code>commits?per_page=1</code> happens to be <code>7c4d0ef91a0ad9d49efa71ec5a637a53e6d87b2f</code>. So the version I pinned is, at this moment, HEAD.</p>
<p>This repo currently has 1 star. Pinning a sha is actually the most reliable choice on an obscure repo, because it does not depend on the author tagging a release, does not go through npm publishing, and does not care if the repo gets renamed. The only cost is that you have to remember to come back and verify once.</p>
<p><img alt="npm version list and the current GitHub HEAD" loading="lazy" src="/images/dsh-plugin-source/fig2.png"></p>
<h2 id="the-local-tarball-line-broke-today">The local tarball line broke today</h2>
<p><code>dsh-plugin-profile-ping</code> says <code>file:/tmp/dsh-plugin-build/dsh-plugin-profile-ping-0.1.0.tgz</code>.</p>
<p>That is something I packaged and dropped in myself. I made a minimal <code>package.json</code> with just this one dependency, ran <code>npm install</code>, and got this:</p>
<blockquote>
<p>npm warn tarball data for dsh-plugin-profile-ping@file:/tmp/dsh-plugin-build/&hellip;tgz (null) seems to be corrupted. Trying again.
npm error code ENOENT
npm error path /tmp/dsh-plugin-build/dsh-plugin-profile-ping-0.1.0.tgz
npm error enoent ENOENT: no such file or directory</p>
</blockquote>
<p><img alt="Minimal reproduction: the raw npm install error" loading="lazy" src="/images/dsh-plugin-source/fig3.png"></p>
<p>The directory <code>/tmp/dsh-plugin-build</code> is gone. macOS clears <code>/tmp</code> on a schedule, and it does not ask your permission.</p>
<p>The most misleading part is that it reports two lines of <code>corrupted</code> first and only admits <code>ENOENT</code> on the third. On seeing corrupted, the first instinct is that the package format is broken and you should repackage it. The actual reason is far simpler: the file itself is gone.</p>
<p>And the matching entry in <code>pnpm-lock.yaml</code> dies along with it: <code>version: file:../../../../../tmp/dsh-plugin-build/dsh-plugin-profile-ping-0.1.0.tgz</code>. Five <code>..</code> segments climb back to the root and then descend into <code>/tmp</code>.</p>
<p>Which means this profile of mine will now get stuck on that one package the next time it is reinstalled. It is not that the whole profile is ruined, it is that the install does not complete.</p>
<h2 id="it-did-leave-a-way-out-just-not-pointed-at-it">It did leave a way out, just not pointed at it</h2>
<p>Lying in <code>~/.dsh/plugin-archives/</code> is <code>dsh-plugin-profile-ping-0.1.0.tgz</code>, 4,162 bytes, dated November 4.</p>
<p>I changed the dependency path to point at that copy, ran the install again, and the result was <code>added 1 package in 102ms</code>.</p>
<p>Same package, same bytes, alive again after a path change. That tarball is dated 2026-11-04. So the only broken line out of my four has a one-line fix: replace <code>/tmp/dsh-plugin-build/</code> with <code>~/.dsh/plugin-archives/</code>.</p>
<p>I unpacked it for a look, seven entries in all. <code>index.js</code> at 6,954 bytes is the main body, <code>README.md</code> at 1,788 bytes, <code>icon.svg</code> at 647 bytes, <code>package.json</code> at 526 bytes, two json files under <code>locale</code> at 199 and 196 bytes, and <code>cordis.patch.yml</code> at only 71 bytes.</p>
<p>The seven entries total 10,381 bytes unpacked, compressed into a 4,162-byte tarball, a 59.9% reduction.</p>
<p><img alt="The seven entries inside the tarball" loading="lazy" src="/images/dsh-plugin-source/fig4.png"></p>
<p><code>package.json</code> contains a line <code>&quot;private&quot;: true</code>. A package with this flag never goes out to npm, so my local copy has no public version to look up, and apart from the file on my own disk there is no backup anywhere.</p>
<h2 id="the-fourth-is-a-link-to-a-source-directory">The fourth is a link to a source directory</h2>
<p>The superagent profile uses yet another notation: <code>dsh-superagent: link:/Users/trevorwang/dsh-superagent</code>.</p>
<p><code>link:</code> is a symlink to a local source directory, not a copy. After editing the code you do not reinstall, the next launch picks up the new one. When developing a plugin this is the smoothest form, with essentially zero cost per try.</p>
<p>The cost is equally direct: no version number, no sha, no tarball. Move the directory or rename it, and the profile becomes a symlink pointing at nothing. Whether it can be reinstalled depends on whether that source directory still exists.</p>
<h2 id="every-plugin-carries-its-own-patch-strip">Every plugin carries its own patch strip</h2>
<p>The four sources go into <code>package.json</code> in very different ways, but once installed they look identical, because they follow the same convention.</p>
<p>All four plugins have a line <code>dsh.bundle.patch</code> in <code>package.json</code>, pointing at the <code>cordis.patch.yml</code> in their own directory. That file holds an insertion declaration stating its own loader id and package name.</p>
<p>The comment in the <code>dsh-workspace-create-dialog</code> copy is the clearest. It reads: &ldquo;bundle patch: inserts this plugin&rsquo;s loader line into the web profile roster. Declared by <code>dsh.bundle.patch</code> in <code>package.json</code>, effective as the profile bundle layer at install time.&rdquo;</p>
<p>The ones with a front end add one more layer. sticky-wall declares <code>client.platform: &quot;web&quot;</code>, and workspace-create-dialog goes further, hanging three UI packages off <code>client.inject</code>: renderer, layout, and workspace. The remaining two are backend-only, with only <code>bundle</code> in the <code>dsh</code> field and no <code>client</code>.</p>
<p>So &ldquo;source&rdquo; only decides how the version resolves. Once installed, everyone takes the same road. That also means a local tarball plugin and a released npm plugin are treated exactly the same at runtime, and you cannot tell which one is the wild one.</p>
<h2 id="only-one-of-the-four-declares-a-version-range">Only one of the four declares a version range</h2>
<p>This is the part I think deserves the most attention.</p>
<p>Besides bundle and client, the <code>dsh</code> field of <code>dsh-workspace-create-dialog</code> has an <code>engines</code> entry: <code>&gt;=0.2.0-rc.2 &lt;0.3.0 || &gt;=0.3.0-0</code>. It tells you plainly which Harness versions this plugin can run on.</p>
<p>The other three declare none. The <code>dsh</code> field of sticky-wall has just two things, <code>bundle</code> and <code>client.platform</code>. ark-image-gen and profile-ping have only <code>bundle</code>.</p>
<p><img alt="Comparison of the dsh fields across the four plugins" loading="lazy" src="/images/dsh-plugin-source/fig5.png"></p>
<p>A plugin without <code>engines</code> is not blocked when installed on an incompatible version. It throws no error at install and no warning at startup. Usually some feature just quietly stops working once it runs, and you have to trace it back yourself.</p>
<p>That also explains one thing: after a Harness upgrade, the plugins that break are often the unassuming little ones. Declaring a range at least blocks you at install time. Declaring nothing leaves it to your memory that the plugin exists.</p>
<h2 id="installable-does-not-mean-reinstallable">Installable does not mean reinstallable</h2>
<p>These days, when I look at a plugin, I check how its dependency line is written first.</p>
<p>A version number is the least trouble, but also the easiest to be pushed along by the author. A pinned sha is the most stable, at the cost of watching upstream yourself. A local tarball is the most free, but as long as that path is not under your control, it can turn into what I hit this morning at any moment. A link to source is the most convenient for development, with no concept of a version at all.</p>
<p>All four install the same way, and during the install you feel no difference. What really decides how long it lives is where that path is, who can delete it, and whether anyone kept a copy for you before it expires.</p>
<p>One more judgment from this half day: the <code>dsh plugin</code> command itself does almost nothing. The help text says it plainly, it just forwards the remaining arguments verbatim to pnpm, executed inside the profile directory.</p>
<p>So plugin source rules are npm source rules. A <code>file:</code> pointing at a nonexistent file gives <code>ENOENT</code>, and dsh has nothing to do with it. Once you know that layer, every problem that seems to happen to Harness can be investigated with plain npm common sense.</p>
<p>By the way, if some <code>file:</code> dependency of yours is sitting in <code>/tmp</code> too, go <code>ls</code> it right now. If it really is gone, <code>~/.dsh/plugin-archives/</code> may still hold a copy.</p>
<p>Of the plugins you have installed now, how many live on a local path? I plan to move all of mine into the archive. Do you think there is anywhere else worth cleaning up at the same time?</p>
]]></content:encoded></item></channel></rss>