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-codearts-complete

v0.2.0

Published

DSH tool + settings page: fill a block of code at a cursor position in an existing file via Huawei Cloud CodeArts (thinking disabled, FIM + instruction mode, optional in-place insert).

Readme

dsh-codearts-complete

A DSH tool: code_complete fills a block of code at a cursor position in an existing file, through Huawei Cloud CodeArts.

Give it a file and a 1-based line/column plus an optional one-line instruction; it reads the text before and after the cursor, asks CodeArts, and returns only the insertion — or writes it into the file with apply: true.

write  file  -> whole files          (DSH's write tool)
edit   file  -> targeted replacements (DSH's edit tool)
code_complete -> "fill 5–20 lines here, keep the surroundings"

Why it exists

Most editor autocomplete is a low-latency local model. This is the opposite trade: a 1.5–3 s cloud call that can produce 10–20 correct lines in one shot. Measured on this machine:

| Request | Latency | Output | | --- | --- | --- | | body of def add(a, b): | 1.4 s | result = a + b | | "3 retries, exponential backoff, 10 s timeout" | 3.2 s | 23-line retry loop | | CSV header-skip parser | 2.4 s | 6 lines |

One thing matters more than the model: enable_thinking: false. The same request without it spends ~190 reasoning tokens and takes ~20 s, often returning an empty message when the token budget runs out.

Requirements

  • DSH (DeepSeek Harness) with the Huawei Cloud CodeArts channel signed in, so that ~/.dsh/.codearts-accounts.json holds a live STS credential. The dsh-codearts plugin (or any CodeArts account plugin) provides that file; this plugin only reads it.
  • Tools service (ctx.get('tools')), i.e. any normal DSH host.

Settings (no restart needed)

DSH settings → CodeArts completion:

| Field | What it does | | --- | --- | | Enable code_complete | Turn the tool off without uninstalling | | Default model | CodeArts model id for completions (empty = deepseek-v4.1-flash-1017) | | Default token budget | Output cap per call (default 256; 400–800 for blocks) | | Credential file | Empty = ~/.dsh/.codearts-accounts.json; point it at your own JSON if you keep credentials elsewhere |

The fields are volatile row config: saving applies to the next code_complete call, no restart.

Credential sources, in priority order:

  1. CODEARTS_ACCESS_KEY_ID + CODEARTS_SECRET_ACCESS_KEY + CODEARTS_SECURITY_TOKEN environment variables.
  2. The file configured in settings (or CODEARTS_ACCOUNTS_FILE), accepting { "accounts": { ... } } or a single { accessKeyId, secretAccessKey, token }.
  3. ~/.dsh/.codearts-accounts.json, maintained by a DSH CodeArts account plugin such as dsh-codearts.

Install

Through the DSH plugin manager (recommended), or manually in a profile:

// profiles/<name>/package.json
"dependencies": { "dsh-codearts-complete": "0.1.0" }

and add "dsh-codearts-complete" to dsh.profile.bundles. Restart DSH afterwards — plugin modules are loaded once at host start.

Tool

{
  "path": "D:/repo/src/fetch.ts",
  "line": 2,
  "column": 3,
  "instruction": "add 3 retries with exponential backoff and a 10 s timeout",
  "apply": true,
  "max_tokens": 500
}

| Field | Required | Meaning | | --- | --- | --- | | path | yes | File to complete in (absolute, or relative to the workspace cwd) | | line | yes | Cursor line, 1-based | | column | no | Cursor column, 1-based (default 1) | | instruction | no | What to write; omit for plain fill-in-the-middle | | apply | no | Insert the completion into the file (default false) | | max_tokens | no | Output budget (default 256; 400–800 for bigger blocks) | | model | no | CodeArts model id (default deepseek-v4.1-flash-1017) |

Returns text, applied, ms, prompt_tokens, completion_tokens, path/line/column, language.

Notes and limits

  • Use it for 5–20 line blocks. A single identifier is not worth a 1.5 s round trip; whole-file generation belongs to write.
  • Each call is one CodeArts request and consumes a little quota.
  • The STS credential lives ~2 hours; DSH's keeper refreshes ~/.dsh/.codearts-accounts.json and this plugin re-reads the file on every call.
  • CodeArts allows 3 concurrent sessions per account; parallel completions queue.
  • Context sent upstream is capped (6 000 chars before the cursor, 2 000 after).

License

MIT