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

@codebam/dsh-tool-nu

v0.1.0

Published

Model-facing Nushell (nu) tool for the DeepSeek Harness: structured pipelines over the existing ctx.shell sandbox world, alongside bash.

Readme

@codebam/dsh-tool-nu

A model-facing nu (Nushell) tool for the DeepSeek Harness.

Each call runs nu --no-config-file --no-history -c <source> in a fresh process and returns stdout/stderr with the same [exit code: N], [stderr], truncation, timeout, and sandbox markers as the stock bash tool. The plugin is a consumer of the existing ctx.shell seam, not a new shell provider: the stock bash tool, its executor, and its sandbox world stay mounted and untouched, and nu simply joins the tool catalog beside bash.

Why a trampoline

dsh composes exactly one provider of ctx.shell; a second registration fails loud. A nu executor package mirroring dsh-bash-sandbox would therefore replace bash, not accompany it. This plugin instead:

  1. sends the Nu source as the ordinary NU_TOOL_SOURCE environment entry on an existing shell request, and
  2. runs <executable> --no-config-file --no-history -c "$NU_TOOL_SOURCE".

Bash expands the quoted variable and does not re-scan the result, so quotes, backticks, $(…), and newlines in the source stay data. The request travels through the mounted executor, so sandbox policy, approval/escalation, timeouts, output caps, spill files, and ctx.jobs background handles are inherited from the world dsh already uses — including the @codebam/dsh-opensandbox profile world.

Install

Add a row to the profile patch (~/.dsh/profiles/<profile>/cordis.patch.yml):

- insert:
    - id: tool-nu
      name: '@codebam/dsh-tool-nu' # or an absolute path to index.mjs
      config:
        executable: nu # prefer an absolute path in deployment
        enableRunInBackground: true

Node resolves this plugin's @deepseek-ai/* peers from the profile's node_modules. dsh populates $DSH_HOME/profiles/node_modules for its own install closure; when loading by file path instead, provide that resolution next to index.mjs (the NixOS route below symlinks it). No bash-sandbox, tool-bash, or terminal row needs disabling.

Configuration

| Field | Default | Meaning | |---|---|---| | executable | nu | Nu executable. Deployments should pin an absolute path such as ${pkgs.nushell}/bin/nu so it resolves inside the execution world. | | enableRunInBackground | true | Expose run_in_background; when false, the field is removed and forced background calls are rejected. |

Tool arguments

The schema mirrors the bash tool call-for-call, so model habits and presenter cards transfer:

| Argument | Required | Meaning | |---|---|---| | command | yes | The Nu source to execute (Nushell pipeline syntax, not bash). | | description | yes | Active-voice UI label, 5–10 words. | | timeoutMs | no | Overrides the executor default; the executor caps it and kills on expiry. | | workdir | no | Per-call working directory; relative paths resolve against the session workspace. | | run_in_background | no | When enabled: return a nu-… job id immediately; collect with job_output, stop with job_kill. | | sandbox_permissions + justification | no | Advertised only when the mounted executor confines; identical one-shot, approval-backed escalation path as the bash tool. |

Model-facing behavior

  • The system-prompt section says: check [exit code: N] on every nu result.
  • The description teaches Nu's structured-data workflow: end data pipelines with | to nuon or | to json -r, and prefix externals with ^.
  • Non-zero exits are results, not tool errors; only infrastructure failures (spawn errors, aborts) are errors. result.aborted throws AbortError.
  • Background jobs are registered with kind nu; their outcome/detail and incremental output go through the generic ctx.jobs runtime and job_output.
  • Managed harness facts are available to Nu as $env.DSH_*.

Deployment (NixOS profile)

This repository carries a staged module for the NixOS profile that pins this plugin and copies it into $DSH_HOME:

Development

npm run peers      # link node_modules/@deepseek-ai to the installed dsh closure
npm test           # node --test (mock-ctx + renderer suites)
npm run test:local # peers + test in one shot
npm run check      # syntax-check every ESM source
npm run pack:check # npm pack --dry-run

npm test uses the real @deepseek-ai/* packages from the installed dsh closure (not mocks of dsh), so it runs the same defineTool schema validation, approveEscalation logic, and shell renderer contract dsh will use at runtime.

Verified

Against dsh 0.1.6-alpha.1 and Nushell 0.115.1:

  • loaded into a real acp composition through the profile patch and a probe tool; apply completed with tools, shell, systemPrompt, and shellEnv injected;
  • 40 + 2 | to nuon returned 42 through the real bash-sandbox executor (exitCode: 0, sandbox workspace-write/full, no denial);
  • background sleep 300ms; 7 | to nuon registered as nu-1, completed with exit code: 0, and read back 7;
  • source containing shell command substitution and backticks executed as literal Nu data, and did not touch the files those substitutions named.

Known limitations

  • Windows: the pwsh executor does not expand $NU_TOOL_SOURCE the way bash does. Disable the row on win32 (disabled: !!js process.platform === 'win32', as the snippets do) until a PowerShell-flavored invocation exists.
  • Source travels in the environment: model commands are small, but multi-megabyte scripts can exceed the OS per-entry limit. A later iteration can stage the script through ctx.fs or nu … /dev/stdin.
  • Structured output is a convention: the tool does not auto-append | to nuon, because a trailing comment or multi-statement script would break. The description instructs the model instead.
  • Fresh process per call: cwd, variables, functions, and history never persist; pass workdir instead of cd.
  • Executor-owned output semantics: truncation tail, spill paths, timeout caps, and background lifetime match the mounted executor (shared with bash).
  • Replay exit pills parse from result text exactly like the bash tool, with the same known residual for output whose final line is itself a marker.

License

MIT. Portions are adapted from @deepseek-ai/dsh-tool-bash (Copyright (c) 2026 DeepSeek, MIT); see LICENSE.