
Security News
Deno Goes the Way of the Dinosaur
Cloudflare is acquiring Deno’s team, which will provide another year of bug fixes and security updates before ending support for the runtime.
@deepseek-ai/dsh-shell-env
Advanced tools
English | 中文
dsh-shell-env provides the trusted DSH_* environment that every model shell call — bash or pwsh — runs with: built-in facts such as DSH_HOME, DSH_SHELL=1, the agent's DSH_SESSION_ID, and the launched profile's DSH_PROFILE and DSH_PROFILE_DIR. Plugin authors can register their own facts with declared keys, collected per execution and disposed with their plugin; duplicate ownership or undeclared runtime keys fail loudly instead of silently overwriting. The registry changes nothing else the model sees — the shell tools own their own schemas and prompts. Choose it in any composition that mounts a model shell tool; configuration only picks the Harness home directory.
Load this plugin in any composition that mounts a model shell tool (dsh-tool-bash or dsh-tool-pwsh): each foreground or background shell call then runs with a freshly collected managed environment instead of whatever DSH_* values the process inherited.
Every call receives DSH_HOME (the absolute Harness home), DSH_SHELL=1, and, for agent calls, DSH_SESSION_ID (the calling session's id). When the launcher provided a profile context, every call also receives DSH_PROFILE (the profile name) and DSH_PROFILE_DIR (its absolute directory; its node_modules holds only profile-installed packages, while the harness's own bundles resolve from the dsh installation); compositions booted without a profile omit both.
Other plugins contribute facts by registering a contributor with a stable name, the complete set of DSH_* keys it may return, a description per key, and a resolver that computes values for one execution:
import type { Context } from '@deepseek-ai/cordis'
import type {} from '@deepseek-ai/dsh-shell-env'
export const inject = ['shellEnv']
export function apply(ctx: Context): void {
ctx.shellEnv.register({
name: 'deployment-region',
variables: { DSH_DEPLOYMENT_REGION: { description: 'Current deployment region.' } },
resolve: execution => execution.agent === undefined ? {} : { DSH_DEPLOYMENT_REGION: 'cn-north' },
})
}
Contributors must declare every key they return; returning an undeclared or non-string value fails the call. Registration is disposed with the registering plugin, so hot-reloading a plugin removes its facts.
The single config field picks the home directory exposed as DSH_HOME; the default resolution order is the dshHome config, then ambient $DSH_HOME, then ~/.dsh.
| Field | Default | Meaning |
|---|---|---|
dshHome | $DSH_HOME, then ~/.dsh | Absolute Harness home exposed as DSH_HOME |
The generated configuration catalog is the exhaustive source for every accepted field and its JSDoc.
Two contributors declaring the same key, or a contributor claiming a reserved built-in (DSH_HOME, DSH_SHELL, DSH_SESSION_ID, DSH_PROFILE, DSH_PROFILE_DIR), fails plugin load loudly. A DSH_* key must be all-caps with underscores (for example DSH_REGION), and a missing description fails registration.
This section explains the design decisions behind the registry and points at the code that realizes them; the observable behavior is fully covered in Use this package.
DSH_* namespace: the shell executor discards inherited DSH_* values and merges the registry's current snapshot for each execution, so nested harnesses and concurrent parent/child agents cannot leak stale identities, and process.env is never modified.DSH_HOME, DSH_SHELL, DSH_SESSION_ID, DSH_PROFILE, and DSH_PROFILE_DIR are reserved for the registry; contributors cannot claim them.| File | Role |
|---|---|
src/index.ts | Plugin entry, ShellEnvRegistry service, and the built-in facts |
| — | No runtime invariant companion is published; the environment registry validates ownership and collected values at each registration/collection; it publishes no independent snapshot that a companion could cross-check. |
collect(execution) starts from the built-ins, adds the session id when the execution carries an agent, then merges each registered contributor's resolved values sorted by contributor name. The result is a frozen, key-sorted snapshot passed through ShellExecRequest.dshEnv. list() enumerates declarations without running resolvers, so it cannot reflect execution-dependent values.
Read these pages when the package-level contract is not enough. They move from the shell family to the executor seam and the generated catalogs.
ctx.shell seam the tools execute through.DSH_HOME is resolved.Indirectly, through the shell tools (dsh-tool-bash, dsh-tool-pwsh), which expose this registry's managed DSH_* facts in every shell-tool call.
The managed environment never enters the request prefix, so it does not invalidate provider cache reuse; the shell tools' definitions and the current request envelope own any prefix change.
These limits define when the registry is a poor fit or needs care. They are current package constraints, not a task backlog.
list() enumerates plugin-contributed variables only — registry-owned built-ins (DSH_HOME, DSH_SHELL, DSH_SESSION_ID, DSH_PROFILE, DSH_PROFILE_DIR) are not included, so diagnostics, prompt, or UI code must not treat list() as an exhaustive environment catalog.None.
FAQs
Tool-independent managed DSH_* shell environment registry
The npm package @deepseek-ai/dsh-shell-env receives a total of 312,840 weekly downloads. As such, @deepseek-ai/dsh-shell-env popularity was classified as popular.
We found that @deepseek-ai/dsh-shell-env demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.

Security News
Cloudflare is acquiring Deno’s team, which will provide another year of bug fixes and security updates before ending support for the runtime.

Security News
Anthropic’s free OSS Scanner uses Mythos and other Claude models to find open source vulnerabilities and send maintainers reports with proposed fixes.

Security News
On Front Lines’ Early Adopters: CISO podcast, Andrew Becherer shares lessons from Datadog, weighs the long-term costs of AI-built tools, and explains how founders can actually gain a CISO’s trust.