Files
deepseek-harness/packages/util/native-command/README.md
T
creatixchu 51402ac7af refactor(util): extract the shared no-shell native-command runner to dsh-native-command
master's toolcall-open extracted runNativeCommand inside apiproxy for the
openPath opener while the picker seam had moved the native chooser (its other
consumer) into directory-picker-native; after the merge the two packages each
carried a verbatim copy. The runner now lives in packages/util/native-command
(zero-dependency library, per the util-group contract) and both native
integrations depend on it.
2026-07-28 21:25:19 +08:00

1.6 KiB

dsh-native-command

English | 中文

A zero-dependency no-shell execFile runner shared by host-native OS integrations: one runNativeCommand(command, args, signal) call spawns the executable directly (never a shell string), captures utf8 stdout/stderr, propagates the caller's abort into child termination, and hides the transient console window on Windows. Failures reject with the exit code and both captured streams attached, so callers classify (missing tool, cancelled, real failure) without re-running anything.

Its two consumers are the host-side native integrations: the directory-picker-native backend's OS chooser commands and the gateway's open-with-default-application hand-off (dsh-host-apiproxy host.openPath). The NativeCommandRunner type is the injectable command boundary those callers expose for deterministic tests.

It is a library, not a service or plugin: no ctx, registers nothing, holds no state, emits no events.

Surface

import { runNativeCommand, type NativeCommandRunner } from '@deepseek-ai/dsh-native-command'

Model Experience

None, as this is host-side subprocess plumbing; nothing here reaches a model request.

KV Cache effect

None; this package neither assembles nor sends a provider request.

Known Limitations and Deferred Work

  • No output bounding — both streams buffer unbounded in memory; every current caller invokes small native tools whose output is a path or an error line. Adopt dsh-retention bounding before pointing this at commands with meaningful output volume.