@deepseek-ai/dsh-tool-bash 0.0.1-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +28 -0
- package/README.i18n.yaml +6 -0
- package/README.md +139 -0
- package/README.zh.md +139 -0
- package/lib/index.js +448 -0
- package/lib/invariant.js +23 -0
- package/lib/types/background.d.ts +19 -0
- package/lib/types/index.d.ts +22 -0
- package/lib/types/invariant.d.ts +16 -0
- package/lib/types/render.d.ts +38 -0
- package/package.json +73 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
BSD 3-Clause License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026, DeepSeek
|
|
4
|
+
|
|
5
|
+
Redistribution and use in source and binary forms, with or without
|
|
6
|
+
modification, are permitted provided that the following conditions are met:
|
|
7
|
+
|
|
8
|
+
1. Redistributions of source code must retain the above copyright notice, this
|
|
9
|
+
list of conditions and the following disclaimer.
|
|
10
|
+
|
|
11
|
+
2. Redistributions in binary form must reproduce the above copyright notice,
|
|
12
|
+
this list of conditions and the following disclaimer in the documentation
|
|
13
|
+
and/or other materials provided with the distribution.
|
|
14
|
+
|
|
15
|
+
3. Neither the name of the copyright holder nor the names of its
|
|
16
|
+
contributors may be used to endorse or promote products derived from
|
|
17
|
+
this software without specific prior written permission.
|
|
18
|
+
|
|
19
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
20
|
+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
21
|
+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
22
|
+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
23
|
+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
24
|
+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
25
|
+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
26
|
+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
27
|
+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
28
|
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
package/README.i18n.yaml
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
# Bilingual-pair consistency record (docs/i18n/README.md): the git blob hash of each
|
|
2
|
+
# side as of the last confirmed-consistent state. Both languages carry equal authority;
|
|
3
|
+
# after editing either side, bring the other along and re-record with:
|
|
4
|
+
# pnpm run verify-translation-pairing --write packages/bash/tool-bash/README.md
|
|
5
|
+
README.md: 9e2cd0c2ed999a11dcbffcd99a1d0cb672367905
|
|
6
|
+
README.zh.md: 8a1e7ba0af36ffd891b38491075ee75283fdbed5
|
package/README.md
ADDED
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
# @deepseek-ai/dsh-tool-bash
|
|
2
|
+
|
|
3
|
+
English | [中文](README.zh.md)
|
|
4
|
+
|
|
5
|
+
The model-facing `bash` tool registered over the `ctx.bash` executor seam. Foreground execution stays behind that seam; a background process handle is registered with the generic `ctx.tasks` runtime and controlled through `task_output`, `task_list`, and `task_kill` from `@deepseek-ai/dsh-tool-tasks`.
|
|
6
|
+
|
|
7
|
+
Requires a loaded executor Service provider (e.g. `@deepseek-ai/dsh-bash-local`) and the [`@deepseek-ai/dsh-bash-env`](../bash-env/README.md) registry; the plugin stays pending until every injected service exists (`inject: ['tools', 'bash', 'systemPrompt', 'bashEnv']`). The tool contract is bash-dialect — mount a bash-parsing executor.
|
|
8
|
+
|
|
9
|
+
The package root exposes only the Cordis plugin contract (`name`, `inject`, `Config`, `apply`); result rendering and background-process adaptation remain package-internal.
|
|
10
|
+
|
|
11
|
+
The plugin also contributes the `tool:bash` prompt section (order 105): check the `[exit code: N]` marker on every result and investigate failures before moving on.
|
|
12
|
+
|
|
13
|
+
## Tools
|
|
14
|
+
|
|
15
|
+
### `bash`
|
|
16
|
+
|
|
17
|
+
| Arg | Type | Notes |
|
|
18
|
+
|---|---|---|
|
|
19
|
+
| `command` | string (required) | Run via `bash -c`. No state persists between calls — use `workdir`, not `cd`. |
|
|
20
|
+
| `description` | string (required) | One-line, active-voice summary of the command (5-10 words), for UI/log display only — no effect on execution. |
|
|
21
|
+
| `timeoutMs` | number | Timeout override in milliseconds. The executor applies its configured default and cap. |
|
|
22
|
+
| `workdir` | string | Working directory for this call. Defaults to the filesystem identity of the calling agent's session cwd (`session.header.cwd`) so each session runs in its own workspace; a relative `workdir` is resolved against that same identity. |
|
|
23
|
+
| `run_in_background` | boolean | Return a task id immediately; no timeout applies. |
|
|
24
|
+
| `sandbox_permissions` | string enum | ADVERTISED ONLY when the mounted executor sandboxes (`ctx.bash.sandboxMode` reports a confining default): the wider mode a denied command needs, from the closed target vocabulary `workspace-write`/`danger-full-access` (never cut down to the executor's default — the effective mode is per-session; strict widening is checked at execution against it, and a non-widening request fails without prompting anyone). |
|
|
25
|
+
| `justification` | string | Required together with `sandbox_permissions` (each without the other is a validation error): one sentence for the user explaining why this exact command needs the wider access. |
|
|
26
|
+
|
|
27
|
+
`command`, `workdir`, and `timeoutMs` are resolved against the executor's config defaults via `ctx.bash.resolve()` before execution, so the Service Definition (`BashExecSpec`) receives explicit `workdir`/`timeoutMs` values. The workdir default is applied in the tool layer from the calling agent's `session.header.cwd` BEFORE `resolve()` — the per-session cwd must come from `exec.agent`, since N sessions share one executor; only when no session cwd is available does the executor fall back to its own config / `process.cwd()`. When sandbox policy is present, the tool reuses its already-canonical `workspaceRoot` as the workdir base so confinement and process launch cannot resolve the same session spelling differently.
|
|
28
|
+
|
|
29
|
+
### Managed shell environment
|
|
30
|
+
|
|
31
|
+
Every foreground and background model bash call receives a freshly collected trusted `DSH_*` environment through the shared [`dsh-bash-env`](../bash-env/README.md) registry: `DSH_HOME` (the absolute Harness home), `DSH_SHELL=1`, the agent's `DSH_SESSION_ID`, and `DSH_SESSION_JSONL` when the active persistence backend locates one. The registry contract — contributor registration, loud duplicate/undeclared-key failure, the built-in reservations, and the contributor example — lives in that package's README. The snapshot passes through the dedicated `BashExecRequest.dshEnv` channel; the local executor removes all inherited `DSH_*` before merging it, so nested harnesses and concurrent parent/child agents cannot leak stale identities, and `process.env` is never modified. The tool description teaches the generic `$DSH_*` convention rather than naming persistence-specific variables or adding a permanent system-prompt section.
|
|
32
|
+
|
|
33
|
+
Result text contains stdout, an optional `[stderr]` section, then applicable sandbox-denial, timeout, signal, exit-code, and truncation markers. Timeout is reported independently of final exit status; nonzero exit remains a model-interpreted result rather than `isError`. Truncation links a safe complete spill file or reports it unavailable. Only infrastructure failures such as spawn errors and aborts produce `isError`.
|
|
34
|
+
|
|
35
|
+
The canonical success is `{ kind: 'foreground', ...BashRunResult }` for a completed foreground process or `{ kind: 'background', taskId }` for a published task. The Native renderer preserves the text above, including exactly `started background task <id>`; programmatic consumers use the typed fields without parsing those strings. Executor stream caps remain acquisition limits on `BashRunResult` and carry their spill paths.
|
|
36
|
+
|
|
37
|
+
When `run_in_background` is true, this plugin preflights `ctx.tasks.start()` before spawning, registers the calling agent as owner, and adapts the returned `BashProcess` handle into generic cancel/done/incremental-output hooks. The task runtime owns ids, cross-session isolation, completion notices, waiting, and disposal cleanup; this plugin only maps bash exit/sandbox facts into task output and outcome detail. `enableRunInBackground: false` removes the parameter and rejects a forced background call at execution time.
|
|
38
|
+
|
|
39
|
+
## UI presentation
|
|
40
|
+
|
|
41
|
+
The tool owns its `presentCall`/`presentResult` render intent. A foreground call is a terminal card carrying command, description, cwd, output, and parsed exit status. Because the card shows the exit as its own pill, the `[exit code: N]` / `[killed by signal: …]` marker the parse consumes leaves the output; every other marker (truncation, timeout, sandbox) stays in it. A background start is a generic execute card because it returns only a task id; the generic `task_*` tools own their own cards. These presenters are pure and replay-safe.
|
|
42
|
+
|
|
43
|
+
## The tool builds its request from named args only
|
|
44
|
+
|
|
45
|
+
`BashExecRequest` carries optional `stdoutMaxBytes`, `stdin`, ordinary `env`, and managed `dshEnv`, used by trusted in-process plugins and this tool's environment registry. The model-facing tool exposes none of `stdoutMaxBytes`, `stdin`, or `env`: it builds requests from named command/workdir/timeout/signal/sandbox fields plus the registry-collected `dshEnv`. Extra model keys are ignored and cannot replace managed values. Shell syntax provides equivalent command-level behavior, while the local executor scrubs ambient credentials and stale `DSH_*` values. See the [stdin/env Agent Note](../../../.agents/notes/implemented/architecture/2026-06-30-bash-stdin-env-trusted-plugin-surface.md).
|
|
46
|
+
|
|
47
|
+
## Permissions and escalation
|
|
48
|
+
|
|
49
|
+
Commands run with the executor's full authority unless a sandboxing executor ([`dsh-bash-sandbox`](../bash-sandbox/)) confines them — the deny-only sandbox reports denials as result facts, rendered here as the denial marker; per-call allow/deny/ask policy is the `tools/pre-execute` waterfall (see docs/architecture.md).
|
|
50
|
+
|
|
51
|
+
Escalating bash calls resolve `ctx.approval` before execution. `allowed-once` applies the requested mode only to that call; rejection, cancellation, unavailability, or missing approval context executes nothing and returns a distinct error. On a real denial, the model may retry the same command once in the same turn with the narrowest sufficient mode and justification; the approval prompt itself is the consent step. Escalation is never speculative, and a disabled or rejected approval is final. The [sandbox Agent Note](../../../.agents/notes/implemented/feature/2026-07-06-sandbox.md) owns the rationale.
|
|
52
|
+
|
|
53
|
+
## Per-session mode switching
|
|
54
|
+
|
|
55
|
+
For sandboxing executors, each call resolves mode as one-shot escalation, then session override, then executor default. Non-sandboxing and agent-less calls carry no session override. The policy owner contributes the current capability-neutral standing mode; denial results still own the operation-specific effective mode and retry guidance. See the [`dsh-bash` fold](../bash/README.md) and [sandbox switching contract](../../../.agents/notes/implemented/feature/2026-07-06-sandbox.md).
|
|
56
|
+
|
|
57
|
+
## Model Experience
|
|
58
|
+
|
|
59
|
+
### System prompt
|
|
60
|
+
|
|
61
|
+
#### What the model sees
|
|
62
|
+
|
|
63
|
+
Every request in this plugin's registration scope contains the bash guidance below. The policy owner contributes current sandbox state through its cache-safe runtime context rather than changing this section. Scoped tool restrictions can hide the schemas without removing this independently registered section.
|
|
64
|
+
|
|
65
|
+
##### Bash guidance
|
|
66
|
+
|
|
67
|
+
```markdown
|
|
68
|
+
Check the [exit code: N] marker on every bash result; investigate failures before moving on.
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
#### Token effect
|
|
72
|
+
|
|
73
|
+
Small fixed input cost per request while the plugin is active, unchanged by sandbox mode or mode switches.
|
|
74
|
+
|
|
75
|
+
#### KV Cache effect
|
|
76
|
+
|
|
77
|
+
Prefix-stable while the registration scope and prompt text are unchanged. Plugin activation or disposal may invalidate reuse from this prompt section; sandbox mode switches do not.
|
|
78
|
+
|
|
79
|
+
### Tool schemas
|
|
80
|
+
|
|
81
|
+
#### What the model sees
|
|
82
|
+
|
|
83
|
+
The model sees the generated [`bash` schema](../../../docs/tool-catalog.md#deepseek-aidsh-tool-bash). `run_in_background` appears only when this producer enables it; `sandbox_permissions` and `justification` appear only when the mounted executor advertises sandboxing. Agent-scoped tool restrictions can remove the definition for that agent.
|
|
84
|
+
|
|
85
|
+
#### Token effect
|
|
86
|
+
|
|
87
|
+
Fixed schema cost on every request where the tools are visible; sandbox support adds the escalation fields and its conditional description paragraph.
|
|
88
|
+
|
|
89
|
+
#### KV Cache effect
|
|
90
|
+
|
|
91
|
+
Prefix-stable while visibility, background support, and executor sandbox capabilities are unchanged. A restriction, config change, or executor change may invalidate reuse from the first changed tool definition.
|
|
92
|
+
|
|
93
|
+
### Foreground result
|
|
94
|
+
|
|
95
|
+
#### What the model sees
|
|
96
|
+
|
|
97
|
+
The renderer emits the data-dependent stdout tail, then optional `[stderr]` and the stderr tail. With no output it emits exactly `(no output)`. Conditional lines are exactly `[output truncated; full output: <path-or-(unavailable)>]`, `[sandbox: file access denied under <mode> mode]`, `[timed out after <timeoutMs>ms]`, `[killed by signal: <signal>]`, and `[exit code: <exitCode>]`; the sandbox escalation and runner-failure lines are quoted in [`dsh-bash-sandbox`](../bash-sandbox/README.md).
|
|
98
|
+
|
|
99
|
+
#### Token effect
|
|
100
|
+
|
|
101
|
+
Zero result tokens before a call. Output is bounded per stream, while each emitted line remains in history until compaction.
|
|
102
|
+
|
|
103
|
+
#### KV Cache effect
|
|
104
|
+
|
|
105
|
+
Append-only; newly visible content follows the reusable request prefix and does not invalidate existing KV-cache entries.
|
|
106
|
+
|
|
107
|
+
### Background task context and results
|
|
108
|
+
|
|
109
|
+
#### What the model sees
|
|
110
|
+
|
|
111
|
+
Start returns exactly `started background task <taskId>`. This producer supplies incremental process output, optional `[some output was dropped from memory; full output: <paths-or-(unavailable)>]`, sandbox facts, and terminal detail such as `exit code: <exitCode>` or `signal: <signal>` to the generic task runtime. [`dsh-tool-tasks`](../../tasks/tool-tasks/README.md) owns the visible status line, completion notice, listing, and cancellation response.
|
|
112
|
+
|
|
113
|
+
#### Token effect
|
|
114
|
+
|
|
115
|
+
The start acknowledgement is small and retained; collected output is data-dependent and bounded by the executor's stream buffers. Consuming reads do not repeat prior output.
|
|
116
|
+
|
|
117
|
+
#### KV Cache effect
|
|
118
|
+
|
|
119
|
+
Append-only; newly visible content follows the reusable request prefix and does not invalidate existing KV-cache entries.
|
|
120
|
+
|
|
121
|
+
### Tool errors
|
|
122
|
+
|
|
123
|
+
#### What the model sees
|
|
124
|
+
|
|
125
|
+
Validation and policy failures are normalized as `Error: <message>`. This package's stable messages are `invalid command: expected a non-empty string`, `invalid description: expected a non-empty string`, `invalid timeoutMs: expected a positive number, got <value>`, `invalid escalation: sandbox_permissions requires a justification`, `invalid escalation: justification is only valid together with sandbox_permissions`, `invalid justification: expected a non-empty sentence`, `background execution is disabled for this bash tool`, `background tasks unavailable: load @deepseek-ai/dsh-tasks and @deepseek-ai/dsh-tool-tasks`, `sandbox_permissions is not available in this composition (no sandboxing executor to escalate)`, `sandbox escalation to "<mode>" is not strictly wider than this call's current "<mode>" mode`, the approval-availability/rejection/cancellation variants, and `tool call aborted`.
|
|
126
|
+
|
|
127
|
+
#### Token effect
|
|
128
|
+
|
|
129
|
+
Only the failing call adds these retained tokens; a rejected escalation does not add command output because the command does not run.
|
|
130
|
+
|
|
131
|
+
#### KV Cache effect
|
|
132
|
+
|
|
133
|
+
Append-only; newly visible content follows the reusable request prefix and does not invalidate existing KV-cache entries.
|
|
134
|
+
|
|
135
|
+
## Known Limitations and Deferred Work
|
|
136
|
+
|
|
137
|
+
- **Replay exit pills parse from result text** — output whose final line happens to be exactly `[exit code: N]` / `[killed by signal: …]` shows a wrong pill on session replay and loses that line from the card body, because the parse treats it as the marker it consumes; a display-only known residual.
|
|
138
|
+
- **The `bash` tool opts out of `timeout-policy` budgets** — it keeps the executor-owned `BASH_TIMEOUT` path, per [the tool-call timeout-policy Agent Note](../../../.agents/notes/implemented/architecture/2026-07-07-tool-call-timeout-policy.md).
|
|
139
|
+
- **Background processes have no executor timeout** — callers must use `task_kill`, or rely on owner/service disposal, when work no longer matters.
|
package/README.zh.md
ADDED
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
# @deepseek-ai/dsh-tool-bash
|
|
2
|
+
|
|
3
|
+
[English](README.md) | 中文
|
|
4
|
+
|
|
5
|
+
模型侧 `bash` 工具,注册在 `ctx.bash` 执行器 seam 上。前台执行始终位于该 seam 之后;后台进程句柄会注册到通用 `ctx.tasks` 运行时,并通过 `task_output`、`task_list` 和 `task_kill` 控制;这些工具由 `@deepseek-ai/dsh-tool-tasks` 提供。
|
|
6
|
+
|
|
7
|
+
需要加载执行器 Service provider(例如 `@deepseek-ai/dsh-bash-local`)与 [`@deepseek-ai/dsh-bash-env`](../bash-env/README.md) 注册表;在每个注入服务就绪之前,插件会保持等待状态(`inject: ['tools', 'bash', 'systemPrompt', 'bashEnv']`)。工具约定是 bash 方言——请挂载能解析 bash 的执行器。
|
|
8
|
+
|
|
9
|
+
包(package)根只公开 Cordis 插件约定(`name`、`inject`、`Config`、`apply`);结果渲染和后台进程适配仍保留在包内部。
|
|
10
|
+
|
|
11
|
+
插件还会提供 `tool:bash` 提示词段落(顺序 105):检查每个结果中的 `[exit code: N]` 标记,发现失败时先调查原因再继续。
|
|
12
|
+
|
|
13
|
+
## 工具
|
|
14
|
+
|
|
15
|
+
### `bash`
|
|
16
|
+
|
|
17
|
+
| 参数 | 类型 | 说明 |
|
|
18
|
+
|---|---|---|
|
|
19
|
+
| `command` | string(必填) | 通过 `bash -c` 运行。调用之间不保留状态;请使用 `workdir`,不要使用 `cd`。 |
|
|
20
|
+
| `description` | string(必填) | 用一行主动语态概述命令(5~10 个词),仅用于 UI/日志显示,不影响执行。 |
|
|
21
|
+
| `timeoutMs` | number | 以毫秒为单位覆盖超时时间。执行器会应用其配置的默认值和上限。 |
|
|
22
|
+
| `workdir` | string | 本次调用的工作目录。默认为调用方 agent(智能体)会话 cwd 的文件系统标识(`session.header.cwd`),使每个会话都在自己的工作区中运行;相对 `workdir` 也以同一标识为基准解析。 |
|
|
23
|
+
| `run_in_background` | boolean | 立即返回 task id;不应用超时。 |
|
|
24
|
+
| `sandbox_permissions` | string enum | 仅当已挂载的执行器启用沙箱时才会公开(`ctx.bash.sandboxMode` 报告一个具有限制作用的默认值):被拒命令所需的更宽模式,取自封闭的目标词汇 `workspace-write`/`danger-full-access`(绝不能缩减为执行器默认值;有效模式按会话确定,执行时会基于它检查是否严格拓宽,未拓宽的请求直接失败,不会向任何人发起提示)。 |
|
|
25
|
+
| `justification` | string | 必须与 `sandbox_permissions` 一同提供(缺少任一项都会产生验证错误):用一句话向用户解释此命令为何需要这项更宽权限。 |
|
|
26
|
+
|
|
27
|
+
执行前,`command`、`workdir` 和 `timeoutMs` 会通过 `ctx.bash.resolve()` 依据执行器配置默认值完成解析,因此 Service Definition(`BashExecSpec`)收到显式的 `workdir`/`timeoutMs` 值。工具层会根据调用方 agent 的 `session.header.cwd` 应用工作目录默认值,然后才调用 `resolve()`:由于 N 个会话共享一个执行器,逐会话 cwd 必须来自 `exec.agent`;只有无法取得会话 cwd 时,执行器才回退到自身配置/`process.cwd()`。存在沙箱策略时,工具会复用已经规范化的 `workspaceRoot` 作为工作目录基准,防止限制逻辑与进程启动过程对同一个会话路径拼写产生不同解析结果。
|
|
28
|
+
|
|
29
|
+
### 托管 shell 环境
|
|
30
|
+
|
|
31
|
+
每次模型发起的前台或后台 bash 调用都会通过共享的 [`dsh-bash-env`](../bash-env/README.md) 注册表收到新收集的一组可信 `DSH_*` 环境变量:`DSH_HOME`(Harness home 绝对路径)、`DSH_SHELL=1`、agent 的 `DSH_SESSION_ID`,以及当活跃持久化后端能定位时的 `DSH_SESSION_JSONL`。注册表约定——贡献方注册、重复/未声明键的响亮失败、内置项保留与贡献方示例——住在该包的 README 里。快照通过专用的 `BashExecRequest.dshEnv` 通道传递;本地执行器会先删除继承的所有 `DSH_*` 再合并,因此嵌套 harness 和并发的父/子 agent 不会泄漏陈旧身份,且绝不修改 `process.env`。工具说明只教授通用 `$DSH_*` 约定,不会点名持久化专用变量,也不会添加永久的系统提示词段落。
|
|
32
|
+
|
|
33
|
+
结果文本依次包含 stdout、可选的 `[stderr]` 段落和适用的沙箱拒绝、超时、信号、退出代码及截断标记。超时与最终退出状态分别报告;非零退出仍是由模型解释的结果,不会成为 `isError`。截断结果会链接安全的完整 spill 文件,或报告文件不可用。只有 spawn 错误和中止等基础设施故障才会产生 `isError`。
|
|
34
|
+
|
|
35
|
+
已完成前台进程的规范成功值为 `{ kind: 'foreground', ...BashRunResult }`,已发布任务则为 `{ kind: 'background', taskId }`。Native renderer 保留上述文本,包括精确的 `started background task <id>`;程序化消费方使用带类型字段,无需解析这些字符串。执行器的流上限仍是 `BashRunResult` 的采集限制,并携带其 spill 路径。
|
|
36
|
+
|
|
37
|
+
当 `run_in_background` 为 true 时,此插件会在 spawn 前预检 `ctx.tasks.start()`,把调用方 agent 注册为持有者,并将返回的 `BashProcess` 句柄适配为通用的取消/完成/增量输出钩子。任务运行时持有 id、跨会话隔离、完成通知、等待和 dispose(资源释放)清理;此插件只把 bash 退出/沙箱事实映射为任务输出和结果详情。`enableRunInBackground: false` 会移除该参数,并在执行时拒绝强制后台调用。
|
|
38
|
+
|
|
39
|
+
## UI 展示
|
|
40
|
+
|
|
41
|
+
工具持有自己的 `presentCall`/`presentResult` 渲染意图。前台调用是终端卡片,包含命令、说明、cwd、输出和解析后的退出状态。由于卡片以独立的 pill 展示退出状态,解析所消耗的 `[exit code: N]` / `[killed by signal: …]` 标记会从输出中移除;其他所有标记(截断、超时、沙箱)都保留在输出中。后台启动只返回 task id,因此使用通用执行卡片;通用 `task_*` 工具持有各自的卡片。这些 presenter 是纯函数,可安全回放。
|
|
42
|
+
|
|
43
|
+
## 工具仅使用具名参数构建请求
|
|
44
|
+
|
|
45
|
+
`BashExecRequest` 携带可选的 `stdoutMaxBytes`、`stdin`、普通 `env` 和托管 `dshEnv`,供可信进程内插件及此工具的环境注册表使用。模型侧工具不公开 `stdoutMaxBytes`、`stdin` 或 `env`:它使用具名的命令/工作目录/超时/信号/沙箱字段,加上从注册表收集的 `dshEnv` 来构建请求。额外模型键会被忽略,无法替换托管值。Shell 语法可以提供等价的命令级行为,而本地执行器会清除环境中的凭据和陈旧 `DSH_*` 值。参见 [stdin/env Agent Note](../../../.agents/notes/implemented/architecture/2026-06-30-bash-stdin-env-trusted-plugin-surface.md)。
|
|
46
|
+
|
|
47
|
+
## 权限与升权
|
|
48
|
+
|
|
49
|
+
除非启用沙箱的执行器([`dsh-bash-sandbox`](../bash-sandbox/))限制命令,否则命令以执行器的完整权限运行。仅拒绝型沙箱会把拒绝作为结果事实报告,并在此渲染为拒绝标记;逐调用的允许/拒绝/询问策略由 `tools/pre-execute` waterfall(瀑布式事件)负责(参见 docs/architecture.md)。
|
|
50
|
+
|
|
51
|
+
需要升权的 bash 调用会在执行前解析 `ctx.approval`。`allowed-once` 只对该次调用应用请求模式;审批被拒、取消、不可用或缺少审批上下文时,命令完全不会执行,并返回不同的错误。发生真实拒绝后,模型可以在同一轮次中使用满足需要的最窄模式和理由重试同一命令一次;审批提示本身就是征求同意的步骤。升权绝不能预先推测,禁用或拒绝审批即为最终结果。其理由由 [沙箱 Agent Note](../../../.agents/notes/implemented/feature/2026-07-06-sandbox.md) 持有。
|
|
52
|
+
|
|
53
|
+
## 逐会话模式切换
|
|
54
|
+
|
|
55
|
+
对于启用沙箱的执行器,每次调用依次按单次升权、会话覆盖、执行器默认值解析模式。未启用沙箱以及没有 agent 的调用不携带会话覆盖。策略归属方贡献当前且不区分具体能力的常驻模式;拒绝结果仍负责操作特定的有效模式与重试引导。参见 [`dsh-bash` 整合](../bash/README.md)和[沙箱切换约定](../../../.agents/notes/implemented/feature/2026-07-06-sandbox.md)。
|
|
56
|
+
|
|
57
|
+
## 模型体验
|
|
58
|
+
|
|
59
|
+
### 系统提示词
|
|
60
|
+
|
|
61
|
+
#### 模型看到的内容
|
|
62
|
+
|
|
63
|
+
此插件注册作用域内的每个请求都包含下方 bash 指引。策略归属方通过自身的缓存安全运行时上下文贡献当前沙箱状态,而不改变此段落。作用域工具限制可以隐藏 schema,但不会移除这个独立注册的段落。
|
|
64
|
+
|
|
65
|
+
##### Bash 指引
|
|
66
|
+
|
|
67
|
+
```markdown
|
|
68
|
+
Check the [exit code: N] marker on every bash result; investigate failures before moving on.
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
#### Token 影响
|
|
72
|
+
|
|
73
|
+
插件活跃期间,每个请求都会产生少量固定输入开销,不受沙箱模式或模式切换影响。
|
|
74
|
+
|
|
75
|
+
#### KV Cache 影响
|
|
76
|
+
|
|
77
|
+
只要注册作用域和提示词文本不变,前缀即可稳定复用。插件激活或 dispose 可能从此提示词段落开始使复用失效;沙箱模式切换不会。
|
|
78
|
+
|
|
79
|
+
### 工具 schema
|
|
80
|
+
|
|
81
|
+
#### 模型看到的内容
|
|
82
|
+
|
|
83
|
+
模型会看到生成的 [`bash` schema](../../../docs/tool-catalog.md#deepseek-aidsh-tool-bash)。仅当此生产方启用 `run_in_background` 时,该字段才会出现;仅当已挂载执行器声明支持沙箱时,`sandbox_permissions` 和 `justification` 才会出现。Agent 作用域的工具限制可以移除该 agent 的定义。
|
|
84
|
+
|
|
85
|
+
#### Token 影响
|
|
86
|
+
|
|
87
|
+
工具可见的每个请求都会产生固定 schema 开销;沙箱支持会增加升权字段及其条件说明段落。
|
|
88
|
+
|
|
89
|
+
#### KV Cache 影响
|
|
90
|
+
|
|
91
|
+
只要可见性、后台支持和执行器沙箱功能保持不变,前缀即可稳定复用。限制、配置或执行器发生变化时,可能从首个变化的工具定义开始使复用失效。
|
|
92
|
+
|
|
93
|
+
### 前台结果
|
|
94
|
+
|
|
95
|
+
#### 模型看到的内容
|
|
96
|
+
|
|
97
|
+
renderer 先输出依数据而定的 stdout 尾部,再输出可选的 `[stderr]` 和 stderr 尾部。没有输出时,它会精确输出 `(no output)`。条件行精确为 `[output truncated; full output: <path-or-(unavailable)>]`、`[sandbox: file access denied under <mode> mode]`、`[timed out after <timeoutMs>ms]`、`[killed by signal: <signal>]` 和 `[exit code: <exitCode>]`;沙箱升权与 runner 故障行原文列于 [`dsh-bash-sandbox`](../bash-sandbox/README.md)。
|
|
98
|
+
|
|
99
|
+
#### Token 影响
|
|
100
|
+
|
|
101
|
+
调用前结果 token 为零。每条流的输出有界,每个已输出行则会保留在历史中,直至压缩(compaction)。
|
|
102
|
+
|
|
103
|
+
#### KV Cache 影响
|
|
104
|
+
|
|
105
|
+
仅追加;新可见内容位于可复用请求前缀之后,不会使现有 KV-cache 条目失效。
|
|
106
|
+
|
|
107
|
+
### 后台任务上下文与结果
|
|
108
|
+
|
|
109
|
+
#### 模型看到的内容
|
|
110
|
+
|
|
111
|
+
启动会精确返回 `started background task <taskId>`。此生产方会向通用任务运行时提供增量进程输出、可选的 `[some output was dropped from memory; full output: <paths-or-(unavailable)>]`、沙箱事实,以及 `exit code: <exitCode>` 或 `signal: <signal>` 等终止详情。[`dsh-tool-tasks`](../../tasks/tool-tasks/README.md) 持有模型可见的状态行、完成通知、列表和取消响应。
|
|
112
|
+
|
|
113
|
+
#### Token 影响
|
|
114
|
+
|
|
115
|
+
启动确认很短并会保留;收集到的输出依数据而定,并受执行器流缓冲区限制。消费式读取不会重复先前输出。
|
|
116
|
+
|
|
117
|
+
#### KV Cache 影响
|
|
118
|
+
|
|
119
|
+
仅追加;新可见内容位于可复用请求前缀之后,不会使现有 KV-cache 条目失效。
|
|
120
|
+
|
|
121
|
+
### 工具错误
|
|
122
|
+
|
|
123
|
+
#### 模型看到的内容
|
|
124
|
+
|
|
125
|
+
验证和策略失败统一为 `Error: <message>`。此包的稳定消息包括 `invalid command: expected a non-empty string`、`invalid description: expected a non-empty string`、`invalid timeoutMs: expected a positive number, got <value>`、`invalid escalation: sandbox_permissions requires a justification`、`invalid escalation: justification is only valid together with sandbox_permissions`、`invalid justification: expected a non-empty sentence`、`background execution is disabled for this bash tool`、`background tasks unavailable: load @deepseek-ai/dsh-tasks and @deepseek-ai/dsh-tool-tasks`、`sandbox_permissions is not available in this composition (no sandboxing executor to escalate)`、`sandbox escalation to "<mode>" is not strictly wider than this call's current "<mode>" mode`、审批不可用/拒绝/取消变体,以及 `tool call aborted`。
|
|
126
|
+
|
|
127
|
+
#### Token 影响
|
|
128
|
+
|
|
129
|
+
只有失败调用会增加这些保留 token;升权被拒时命令不会运行,因此不会添加命令输出。
|
|
130
|
+
|
|
131
|
+
#### KV Cache 影响
|
|
132
|
+
|
|
133
|
+
仅追加;新可见内容位于可复用请求前缀之后,不会使现有 KV-cache 条目失效。
|
|
134
|
+
|
|
135
|
+
## 已知限制与延期工作
|
|
136
|
+
|
|
137
|
+
- **回放退出状态 pill 从结果文本解析**:如果输出最后一行恰好精确为 `[exit code: N]` / `[killed by signal: …]`,会话回放将显示错误的 pill,并且该行会从卡片正文中丢失,因为解析会把它当作自己消耗的标记;这是仅影响展示的已知残留问题。
|
|
138
|
+
- **`bash` 工具不采用 `timeout-policy` 预算**:根据[工具调用 timeout-policy Agent Note](../../../.agents/notes/implemented/architecture/2026-07-07-tool-call-timeout-policy.md),它保留由执行器持有的 `BASH_TIMEOUT` 路径。
|
|
139
|
+
- **后台进程没有执行器超时**:工作不再需要时,调用方必须使用 `task_kill`,或依赖持有者/服务的 dispose。
|
package/lib/index.js
ADDED
|
@@ -0,0 +1,448 @@
|
|
|
1
|
+
import z from "@deepseek-ai/schemastery";
|
|
2
|
+
import { isAbsolute, resolve } from "node:path";
|
|
3
|
+
import { TOOL_ABORTED, defineTool } from "@deepseek-ai/dsh-tools";
|
|
4
|
+
import { HarnessError } from "@deepseek-ai/dsh-llm";
|
|
5
|
+
import { ESCALATION_TARGETS, approveEscalation, canonicalPath, escalationHintMarker, sandboxDenialMarker, validateEscalationArgs } from "@deepseek-ai/dsh-sandbox";
|
|
6
|
+
import { DSH_ENV_PREFIX, parseExitStatus } from "@deepseek-ai/dsh-bash";
|
|
7
|
+
//#region lib/types/background.js
|
|
8
|
+
/**
|
|
9
|
+
* Generic-task adaptation for background bash process handles.
|
|
10
|
+
*
|
|
11
|
+
* @module @deepseek-ai/dsh-tool-bash/background
|
|
12
|
+
*/
|
|
13
|
+
/**
|
|
14
|
+
* Map a settled background process onto the generic task-outcome vocabulary:
|
|
15
|
+
* `killed` stays `killed` (detail: the signal when one is known), everything
|
|
16
|
+
* else is `completed` with the exit code as detail. A nonzero command exit is
|
|
17
|
+
* reported, not failed, exactly like the foreground rendering.
|
|
18
|
+
* @param proc - the settled process handle.
|
|
19
|
+
* @returns the outcome for the `ctx.tasks` registration.
|
|
20
|
+
*/
|
|
21
|
+
function processOutcome(proc) {
|
|
22
|
+
if (proc.status === "killed") return {
|
|
23
|
+
status: "killed",
|
|
24
|
+
detail: proc.signal !== null ? `signal: ${proc.signal}` : "killed before exit"
|
|
25
|
+
};
|
|
26
|
+
return {
|
|
27
|
+
status: "completed",
|
|
28
|
+
detail: `exit code: ${proc.exitCode ?? 0}`
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
//#endregion
|
|
32
|
+
//#region lib/types/render.js
|
|
33
|
+
/**
|
|
34
|
+
* Model-facing result rendering for the bash tool.
|
|
35
|
+
*
|
|
36
|
+
* @module @deepseek-ai/dsh-tool-bash/render
|
|
37
|
+
*/
|
|
38
|
+
/** Append the truncation notice (with the full-output spill path) to a stream's text. */
|
|
39
|
+
function streamText(output) {
|
|
40
|
+
if (!output.truncated) return output.text;
|
|
41
|
+
return `${output.text}\n[output truncated; full output: ${output.spillPath ?? "(unavailable)"}]`;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Shape one finished run into the text the model sees: stdout, then a marked
|
|
45
|
+
* stderr section, then exit-status markers. Non-zero exits are reported, not
|
|
46
|
+
* errored — the model decides how to react; only infrastructure failures
|
|
47
|
+
* (spawn errors, aborts) surface as isError results.
|
|
48
|
+
* @param result - the completed foreground run from the executor.
|
|
49
|
+
* @param escalationModes - the escalation targets this composition advertises;
|
|
50
|
+
* non-empty adds the same-turn escalation hint after a denial marker
|
|
51
|
+
* (default `[]`: no hint).
|
|
52
|
+
* @returns the model-facing text: output body (or `(no output)`), then any timeout/signal/exit markers, each on its own line.
|
|
53
|
+
*/
|
|
54
|
+
function renderResult(result, escalationModes = []) {
|
|
55
|
+
const out = streamText(result.stdout);
|
|
56
|
+
const err = streamText(result.stderr);
|
|
57
|
+
let body = out;
|
|
58
|
+
if (err.length > 0) {
|
|
59
|
+
if (body.length > 0 && !body.endsWith("\n")) body += "\n";
|
|
60
|
+
body += `[stderr]\n${err}`;
|
|
61
|
+
}
|
|
62
|
+
if (body.length === 0) body = "(no output)";
|
|
63
|
+
const markers = [];
|
|
64
|
+
if (result.sandbox?.denied) {
|
|
65
|
+
markers.push(sandboxDenialMarker(result.sandbox.mode));
|
|
66
|
+
if (escalationModes.length > 0) markers.push(escalationHintMarker("command"));
|
|
67
|
+
}
|
|
68
|
+
if (result.timedOut) markers.push(`[timed out after ${result.timeoutMs}ms]`);
|
|
69
|
+
if (result.signal !== null) markers.push(`[killed by signal: ${result.signal}]`);
|
|
70
|
+
else if (result.exitCode !== 0) markers.push(`[exit code: ${result.exitCode}]`);
|
|
71
|
+
if (markers.length === 0) return body;
|
|
72
|
+
if (!body.endsWith("\n")) body += "\n";
|
|
73
|
+
return body + markers.join("\n");
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Shape one background-process read into the `task_output` delta the model
|
|
77
|
+
* sees: the incremental delta, plus the lossy-read notice (with full-stream
|
|
78
|
+
* spill paths) when in-memory truncation dropped unread bytes. Empty-delta
|
|
79
|
+
* rendering (`(no new output)`) is the generic control surface's job.
|
|
80
|
+
* @param read - one incremental read from the process handle.
|
|
81
|
+
* @param sandbox - settled sandbox facts, when this was a confined process.
|
|
82
|
+
* @param escalationModes - escalation targets advertised by this composition.
|
|
83
|
+
* @returns the delta text with any loss or sandbox notice appended.
|
|
84
|
+
*/
|
|
85
|
+
function renderProcessRead(read, sandbox, escalationModes = []) {
|
|
86
|
+
const notices = [];
|
|
87
|
+
if (read.lossy) {
|
|
88
|
+
const paths = [read.stdoutSpillPath, read.stderrSpillPath].filter((path) => path !== void 0);
|
|
89
|
+
notices.push(`[some output was dropped from memory; full output: ${paths.length > 0 ? paths.join(", ") : "(unavailable)"}]`);
|
|
90
|
+
}
|
|
91
|
+
if (sandbox?.runnerFailed) notices.push(`[sandbox: the sandbox runner itself failed under ${sandbox.mode} mode — the command did not run; this is a sandbox problem, not a command failure]`);
|
|
92
|
+
else if (sandbox?.denied) {
|
|
93
|
+
notices.push(sandboxDenialMarker(sandbox.mode));
|
|
94
|
+
if (escalationModes.length > 0) notices.push(escalationHintMarker("command"));
|
|
95
|
+
}
|
|
96
|
+
if (notices.length === 0) return read.delta;
|
|
97
|
+
return `${read.delta}${read.delta.length > 0 && !read.delta.endsWith("\n") ? "\n" : ""}${notices.join("\n")}`;
|
|
98
|
+
}
|
|
99
|
+
//#endregion
|
|
100
|
+
//#region lib/types/index.js
|
|
101
|
+
/**
|
|
102
|
+
* Model-facing Consumer of the `ctx.bash` capability seam. Background calls
|
|
103
|
+
* register process handles with `ctx.tasks`; their work uses task cancellation
|
|
104
|
+
* rather than the tool-call signal after an id is returned.
|
|
105
|
+
*
|
|
106
|
+
* TODO(permissions): deployment policy belongs in `tools/pre-execute` and
|
|
107
|
+
* sandboxing executors; see docs/architecture.md § Extending The Harness.
|
|
108
|
+
* @module @deepseek-ai/dsh-tool-bash
|
|
109
|
+
*/
|
|
110
|
+
const name = "tool-bash";
|
|
111
|
+
const inject = [
|
|
112
|
+
"tools",
|
|
113
|
+
"bash",
|
|
114
|
+
"systemPrompt",
|
|
115
|
+
"bashEnv"
|
|
116
|
+
];
|
|
117
|
+
/** Runtime configuration schema for the bash tool plugin. */
|
|
118
|
+
const Config = z.object({ enableRunInBackground: z.boolean().default(true) });
|
|
119
|
+
function validateBashArgs(args) {
|
|
120
|
+
if (args.command.trim().length === 0) throw new Error("invalid command: expected a non-empty string");
|
|
121
|
+
if (args.description.trim().length === 0) throw new Error("invalid description: expected a non-empty string");
|
|
122
|
+
if (args.timeoutMs !== void 0 && (!Number.isFinite(args.timeoutMs) || args.timeoutMs <= 0)) throw new Error(`invalid timeoutMs: expected a positive number, got ${JSON.stringify(args.timeoutMs)}`);
|
|
123
|
+
validateEscalationArgs(args.sandbox_permissions, args.justification);
|
|
124
|
+
}
|
|
125
|
+
function bashDescription(backgroundEnabled, escalationModes) {
|
|
126
|
+
const background = backgroundEnabled ? "Set `run_in_background: true` for long-running commands: the call returns a task id immediately; read its output with `task_output` and stop it with `task_kill`." : "Background execution is not available; long-running commands must finish within the timeout.";
|
|
127
|
+
const base = `Execute a bash command (\`bash -c\`) and return its stdout/stderr. Each call runs in a fresh shell: no state (cwd, variables, functions) persists between calls — pass \`workdir\` instead of using \`cd\`. Non-zero exits are reported as \`[exit code: N]\`. Current harness environment facts are exposed through managed \`$${DSH_ENV_PREFIX}*\` variables; inspect them when needed. Commands may run under a file sandbox; a blocked file operation is reported as \`[sandbox: file access denied under <mode> mode]\` — a policy denial, not a bug in the command; do not retry another way. Long output is truncated to its tail; the full output is saved to a file whose path is reported when available. ` + background;
|
|
128
|
+
if (escalationModes.length === 0) return base;
|
|
129
|
+
return base + " Attempting a command the sandbox may deny is safe and expected: run it and read the marker rather than assuming the denial. When a command is denied and a wider mode would let it succeed, escalate immediately in the same turn — the one sanctioned exception to a denial: retry the exact same command once with `sandbox_permissions` (the narrowest wider mode that suffices) plus a one-sentence `justification`. Do not detour through chat to ask permission first — the approval prompt raised by that retry is how the user consents. If the session states approval prompts are disabled, there is no exception: a denial is final — do not set `sandbox_permissions`. Never escalate speculatively: ground the request in a real denial — normally the one this command just hit; escalating up front is fine only when this session already denied the same access. A rejected escalation is final for that command — stop and explain, never work around it — but it does not forbid attempting or escalating other commands later.";
|
|
130
|
+
}
|
|
131
|
+
function presentBashCall(args) {
|
|
132
|
+
if (args.run_in_background === true) return {
|
|
133
|
+
card: "generic",
|
|
134
|
+
title: args.command,
|
|
135
|
+
kind: "execute",
|
|
136
|
+
rawInput: args.command,
|
|
137
|
+
content: [{
|
|
138
|
+
type: "text",
|
|
139
|
+
text: args.description
|
|
140
|
+
}]
|
|
141
|
+
};
|
|
142
|
+
return {
|
|
143
|
+
card: "terminal",
|
|
144
|
+
title: args.command,
|
|
145
|
+
description: args.description,
|
|
146
|
+
...args.workdir !== void 0 ? { cwd: args.workdir } : {}
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* Present completed foreground output as a terminal; background acknowledgements
|
|
151
|
+
* and execution errors use generic fenced output without an exit-status pill.
|
|
152
|
+
*/
|
|
153
|
+
function presentBashResult(args, result) {
|
|
154
|
+
const block = result.content.length === 1 ? result.content[0] : void 0;
|
|
155
|
+
if (block === void 0 || block.type !== "text") return void 0;
|
|
156
|
+
const raw = block.text;
|
|
157
|
+
if (typeof args === "object" && args !== null && args.run_in_background === true || result.isError) return {
|
|
158
|
+
card: "generic",
|
|
159
|
+
content: [{
|
|
160
|
+
type: "text",
|
|
161
|
+
text: `\`\`\`console\n${raw.replace(/\n+$/, "")}\n\`\`\``
|
|
162
|
+
}]
|
|
163
|
+
};
|
|
164
|
+
const { body, ...exit } = parseExitStatus(raw);
|
|
165
|
+
return {
|
|
166
|
+
card: "terminal",
|
|
167
|
+
output: body,
|
|
168
|
+
...exit
|
|
169
|
+
};
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* Resolve an explicit workdir first, making a relative one session-workspace-relative;
|
|
173
|
+
* otherwise use the filesystem identity of the session cwd and leave executor
|
|
174
|
+
* defaulting as the fallback. A resolved sandbox-policy root wins so workdir
|
|
175
|
+
* and confinement use the exact same per-call identity.
|
|
176
|
+
*/
|
|
177
|
+
function resolveWorkdir(modelWorkdir, exec, policyWorkspaceRoot) {
|
|
178
|
+
const headerCwd = exec.agent?.session.header.cwd;
|
|
179
|
+
const sessionCwd = policyWorkspaceRoot ?? (headerCwd === void 0 ? void 0 : canonicalPath(headerCwd));
|
|
180
|
+
if (modelWorkdir === void 0) return sessionCwd;
|
|
181
|
+
if (sessionCwd !== void 0 && !isAbsolute(modelWorkdir)) return resolve(sessionCwd, modelWorkdir);
|
|
182
|
+
return modelWorkdir;
|
|
183
|
+
}
|
|
184
|
+
/** Detach the executor DTO from readonly Service Definition types into plain JSON data. */
|
|
185
|
+
function canonicalBashResult(result) {
|
|
186
|
+
const output = (stream) => ({
|
|
187
|
+
text: stream.text,
|
|
188
|
+
truncated: stream.truncated,
|
|
189
|
+
...stream.spillPath !== void 0 ? { spillPath: stream.spillPath } : {}
|
|
190
|
+
});
|
|
191
|
+
return {
|
|
192
|
+
exitCode: result.exitCode,
|
|
193
|
+
signal: result.signal,
|
|
194
|
+
timedOut: result.timedOut,
|
|
195
|
+
aborted: result.aborted,
|
|
196
|
+
timeoutMs: result.timeoutMs,
|
|
197
|
+
stdout: output(result.stdout),
|
|
198
|
+
stderr: output(result.stderr),
|
|
199
|
+
...result.sandbox !== void 0 ? { sandbox: {
|
|
200
|
+
mode: result.sandbox.mode,
|
|
201
|
+
denied: result.sandbox.denied,
|
|
202
|
+
...result.sandbox.enforcement !== void 0 ? { enforcement: result.sandbox.enforcement } : {},
|
|
203
|
+
...result.sandbox.runnerFailed !== void 0 ? { runnerFailed: result.sandbox.runnerFailed } : {}
|
|
204
|
+
} } : {}
|
|
205
|
+
};
|
|
206
|
+
}
|
|
207
|
+
/** Canonical background-handle properties shared by the bash output union. */
|
|
208
|
+
const BACKGROUND_OUTPUT_PROPERTIES = {
|
|
209
|
+
kind: {
|
|
210
|
+
type: "string",
|
|
211
|
+
required: true,
|
|
212
|
+
const: "background"
|
|
213
|
+
},
|
|
214
|
+
taskId: {
|
|
215
|
+
type: "string",
|
|
216
|
+
required: true
|
|
217
|
+
}
|
|
218
|
+
};
|
|
219
|
+
function apply(ctx, config = {}) {
|
|
220
|
+
const backgroundEnabled = config.enableRunInBackground ?? true;
|
|
221
|
+
const defaultMode = ctx.bash.sandboxMode;
|
|
222
|
+
const escalationModes = defaultMode === void 0 ? [] : ESCALATION_TARGETS;
|
|
223
|
+
const sandboxPolicy = defaultMode === void 0 ? void 0 : ctx.get("sandboxPolicy");
|
|
224
|
+
if (defaultMode !== void 0 && sandboxPolicy === void 0) throw new Error("tool-bash: the mounted bash executor confines but ctx.sandboxPolicy is missing");
|
|
225
|
+
/** Resolve the complete standing policy for this call when a confining executor is mounted. */
|
|
226
|
+
const resolveSandboxPolicy = (exec) => sandboxPolicy?.resolve(exec.agent === void 0 ? {} : { session: exec.agent.session });
|
|
227
|
+
/**
|
|
228
|
+
* Resolve a sandbox-escalation request through `ctx.approval` BEFORE
|
|
229
|
+
* anything executes, delegating the shared fail-closed sequence (strict
|
|
230
|
+
* widening, channel resolution, outcome mapping) to
|
|
231
|
+
* {@link approveEscalation}. This tool contributes only the composition
|
|
232
|
+
* guard (the fields are unadvertised without a sandboxing executor, yet
|
|
233
|
+
* schema validation checks advertised keys only, so an unadvertised
|
|
234
|
+
* `sandbox_permissions` still reaches execute) and the approval
|
|
235
|
+
* ingredients. The shared policy resolver is required whenever the executor
|
|
236
|
+
* advertises confinement, so a split composition fails at tool-plugin load.
|
|
237
|
+
*/
|
|
238
|
+
const approveBashEscalation = (mode, justification, exec, standingPolicy) => {
|
|
239
|
+
if (escalationModes.length === 0) throw new Error("sandbox_permissions is not available in this composition (no sandboxing executor to escalate)");
|
|
240
|
+
const effectiveMode = standingPolicy.mode;
|
|
241
|
+
return approveEscalation({
|
|
242
|
+
requestedMode: mode,
|
|
243
|
+
justification,
|
|
244
|
+
effectiveMode,
|
|
245
|
+
subject: "command"
|
|
246
|
+
}, {
|
|
247
|
+
approver: ctx.get("approval"),
|
|
248
|
+
agent: exec.agent,
|
|
249
|
+
callId: exec.callId,
|
|
250
|
+
toolName: "bash",
|
|
251
|
+
signal: exec.signal
|
|
252
|
+
});
|
|
253
|
+
};
|
|
254
|
+
ctx.systemPrompt.section({
|
|
255
|
+
name: "tool:bash",
|
|
256
|
+
order: 105,
|
|
257
|
+
text: "Check the [exit code: N] marker on every bash result; investigate failures before moving on."
|
|
258
|
+
});
|
|
259
|
+
ctx.tools.register(defineTool({
|
|
260
|
+
name: "bash",
|
|
261
|
+
description: bashDescription(backgroundEnabled, escalationModes),
|
|
262
|
+
parameters: {
|
|
263
|
+
command: {
|
|
264
|
+
type: "string",
|
|
265
|
+
required: true,
|
|
266
|
+
description: "The bash command to execute."
|
|
267
|
+
},
|
|
268
|
+
description: {
|
|
269
|
+
type: "string",
|
|
270
|
+
required: true,
|
|
271
|
+
description: "Clear, concise description of what this command does in active voice, 5-10 words (shown in the UI). Examples: \"ls\" → \"List files in current directory\"; \"git status\" → \"Show working tree status\"; \"npm install\" → \"Install package dependencies\"."
|
|
272
|
+
},
|
|
273
|
+
timeoutMs: {
|
|
274
|
+
type: "number",
|
|
275
|
+
description: "Timeout in milliseconds. The executor applies its configured default and cap, and kills the command on expiry."
|
|
276
|
+
},
|
|
277
|
+
workdir: {
|
|
278
|
+
type: "string",
|
|
279
|
+
description: "Working directory for this command. Defaults to the session workspace; a relative path is resolved against it."
|
|
280
|
+
},
|
|
281
|
+
...backgroundEnabled ? { run_in_background: {
|
|
282
|
+
type: "boolean",
|
|
283
|
+
description: "Run in the background and return a task id immediately (collect with task_output, stop with task_kill). No timeout applies."
|
|
284
|
+
} } : {},
|
|
285
|
+
...escalationModes.length > 0 ? {
|
|
286
|
+
sandbox_permissions: {
|
|
287
|
+
type: "string",
|
|
288
|
+
enum: [...escalationModes],
|
|
289
|
+
description: "The wider sandbox mode this command needs. Only valid as a one-shot retry of a command the sandbox just denied; requires justification and user approval."
|
|
290
|
+
},
|
|
291
|
+
justification: {
|
|
292
|
+
type: "string",
|
|
293
|
+
description: "Required with sandbox_permissions: one sentence for the user explaining why this exact command needs the wider access."
|
|
294
|
+
}
|
|
295
|
+
} : {}
|
|
296
|
+
},
|
|
297
|
+
output: {
|
|
298
|
+
schema: { oneOf: [{
|
|
299
|
+
type: "object",
|
|
300
|
+
additionalProperties: false,
|
|
301
|
+
properties: BACKGROUND_OUTPUT_PROPERTIES
|
|
302
|
+
}, {
|
|
303
|
+
type: "object",
|
|
304
|
+
additionalProperties: false,
|
|
305
|
+
properties: {
|
|
306
|
+
kind: {
|
|
307
|
+
type: "string",
|
|
308
|
+
required: true,
|
|
309
|
+
const: "foreground"
|
|
310
|
+
},
|
|
311
|
+
exitCode: {
|
|
312
|
+
required: true,
|
|
313
|
+
oneOf: [{ type: "integer" }, { type: "null" }]
|
|
314
|
+
},
|
|
315
|
+
signal: {
|
|
316
|
+
required: true,
|
|
317
|
+
oneOf: [{ type: "string" }, { type: "null" }]
|
|
318
|
+
},
|
|
319
|
+
timedOut: {
|
|
320
|
+
type: "boolean",
|
|
321
|
+
required: true
|
|
322
|
+
},
|
|
323
|
+
aborted: {
|
|
324
|
+
type: "boolean",
|
|
325
|
+
required: true
|
|
326
|
+
},
|
|
327
|
+
timeoutMs: {
|
|
328
|
+
type: "number",
|
|
329
|
+
required: true
|
|
330
|
+
},
|
|
331
|
+
stdout: {
|
|
332
|
+
type: "object",
|
|
333
|
+
additionalProperties: false,
|
|
334
|
+
required: true,
|
|
335
|
+
properties: {
|
|
336
|
+
text: {
|
|
337
|
+
type: "string",
|
|
338
|
+
required: true
|
|
339
|
+
},
|
|
340
|
+
truncated: {
|
|
341
|
+
type: "boolean",
|
|
342
|
+
required: true
|
|
343
|
+
},
|
|
344
|
+
spillPath: { type: "string" }
|
|
345
|
+
}
|
|
346
|
+
},
|
|
347
|
+
stderr: {
|
|
348
|
+
type: "object",
|
|
349
|
+
additionalProperties: false,
|
|
350
|
+
required: true,
|
|
351
|
+
properties: {
|
|
352
|
+
text: {
|
|
353
|
+
type: "string",
|
|
354
|
+
required: true
|
|
355
|
+
},
|
|
356
|
+
truncated: {
|
|
357
|
+
type: "boolean",
|
|
358
|
+
required: true
|
|
359
|
+
},
|
|
360
|
+
spillPath: { type: "string" }
|
|
361
|
+
}
|
|
362
|
+
},
|
|
363
|
+
sandbox: {
|
|
364
|
+
type: "object",
|
|
365
|
+
additionalProperties: false,
|
|
366
|
+
properties: {
|
|
367
|
+
mode: {
|
|
368
|
+
type: "string",
|
|
369
|
+
required: true
|
|
370
|
+
},
|
|
371
|
+
denied: {
|
|
372
|
+
type: "boolean",
|
|
373
|
+
required: true
|
|
374
|
+
},
|
|
375
|
+
enforcement: { type: "string" },
|
|
376
|
+
runnerFailed: { type: "boolean" }
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
}] },
|
|
381
|
+
render: (_args, value) => [{
|
|
382
|
+
type: "text",
|
|
383
|
+
text: value.kind === "background" ? `started background task ${value.taskId}` : renderResult(value, escalationModes)
|
|
384
|
+
}]
|
|
385
|
+
},
|
|
386
|
+
async execute(args, exec) {
|
|
387
|
+
validateBashArgs(args);
|
|
388
|
+
const standingPolicy = resolveSandboxPolicy(exec);
|
|
389
|
+
const approvedMode = args.sandbox_permissions !== void 0 && args.justification !== void 0 ? await approveBashEscalation(args.sandbox_permissions, args.justification, exec, standingPolicy) : void 0;
|
|
390
|
+
const policy = approvedMode === void 0 ? standingPolicy : {
|
|
391
|
+
...standingPolicy,
|
|
392
|
+
mode: approvedMode
|
|
393
|
+
};
|
|
394
|
+
const workdir = resolveWorkdir(args.workdir, exec, standingPolicy?.workspaceRoot);
|
|
395
|
+
const dshEnv = ctx.bashEnv.collect(exec);
|
|
396
|
+
const request = {
|
|
397
|
+
command: args.command,
|
|
398
|
+
...workdir !== void 0 ? { workdir } : {},
|
|
399
|
+
...args.timeoutMs !== void 0 ? { timeoutMs: args.timeoutMs } : {},
|
|
400
|
+
dshEnv,
|
|
401
|
+
...policy !== void 0 ? { sandboxPolicy: policy } : {}
|
|
402
|
+
};
|
|
403
|
+
if (args.run_in_background === true) {
|
|
404
|
+
if (!backgroundEnabled) throw new Error("run_in_background is disabled for this deployment (enableRunInBackground: false)");
|
|
405
|
+
const tasks = ctx.get("tasks");
|
|
406
|
+
if (tasks === void 0) throw new Error("background tasks unavailable: load @deepseek-ai/dsh-tasks and @deepseek-ai/dsh-tool-tasks");
|
|
407
|
+
if (exec.signal.aborted) {
|
|
408
|
+
const error = new HarnessError("tool call aborted", TOOL_ABORTED);
|
|
409
|
+
error.name = "AbortError";
|
|
410
|
+
throw error;
|
|
411
|
+
}
|
|
412
|
+
return {
|
|
413
|
+
kind: "background",
|
|
414
|
+
taskId: tasks.start({
|
|
415
|
+
kind: "bash",
|
|
416
|
+
label: args.command,
|
|
417
|
+
...exec.agent ? { owner: exec.agent } : {},
|
|
418
|
+
run: () => {
|
|
419
|
+
const proc = ctx.bash.start(ctx.bash.resolve(request));
|
|
420
|
+
return {
|
|
421
|
+
cancel: () => void proc.kill(),
|
|
422
|
+
done: proc.done.then(() => processOutcome(proc)),
|
|
423
|
+
readOutput: () => renderProcessRead(proc.readOutput(), proc.sandbox, escalationModes)
|
|
424
|
+
};
|
|
425
|
+
}
|
|
426
|
+
})
|
|
427
|
+
};
|
|
428
|
+
}
|
|
429
|
+
const result = await ctx.bash.run(ctx.bash.resolve({
|
|
430
|
+
...request,
|
|
431
|
+
signal: exec.signal
|
|
432
|
+
}));
|
|
433
|
+
if (result.aborted) {
|
|
434
|
+
const error = new HarnessError("tool call aborted", TOOL_ABORTED);
|
|
435
|
+
error.name = "AbortError";
|
|
436
|
+
throw error;
|
|
437
|
+
}
|
|
438
|
+
return {
|
|
439
|
+
kind: "foreground",
|
|
440
|
+
...canonicalBashResult(result)
|
|
441
|
+
};
|
|
442
|
+
},
|
|
443
|
+
presentCall: presentBashCall,
|
|
444
|
+
presentResult: presentBashResult
|
|
445
|
+
}));
|
|
446
|
+
}
|
|
447
|
+
//#endregion
|
|
448
|
+
export { Config, apply, inject, name };
|
package/lib/invariant.js
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
//#region lib/types/invariant.js
|
|
2
|
+
/**
|
|
3
|
+
* Package-owned invariant companion for `@deepseek-ai/dsh-tool-bash`.
|
|
4
|
+
* @module @deepseek-ai/dsh-tool-bash/invariant
|
|
5
|
+
*/
|
|
6
|
+
const PACKAGE_NAME = "@deepseek-ai/dsh-tool-bash";
|
|
7
|
+
/** Cordis companion plugin name. */
|
|
8
|
+
const name = "tool-bash-invariant";
|
|
9
|
+
/** Service required before the companion can reserve package ownership. */
|
|
10
|
+
const inject = ["invariants"];
|
|
11
|
+
/**
|
|
12
|
+
* No runtime invariant: the environment registry validates ownership and collected values at each
|
|
13
|
+
* mutation/read; it publishes no independent snapshot that a companion could cross-check.
|
|
14
|
+
*/
|
|
15
|
+
const install = () => {};
|
|
16
|
+
/**
|
|
17
|
+
* Register this package's invariant companion.
|
|
18
|
+
* @param ctx - Cordis context carrying the invariant service.
|
|
19
|
+
* @returns the installed registration's disposer after setup succeeds.
|
|
20
|
+
*/
|
|
21
|
+
const apply = (ctx) => Promise.resolve(ctx.invariants.register(PACKAGE_NAME, install));
|
|
22
|
+
//#endregion
|
|
23
|
+
export { apply, inject, name };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generic-task adaptation for background bash process handles.
|
|
3
|
+
*
|
|
4
|
+
* @module @deepseek-ai/dsh-tool-bash/background
|
|
5
|
+
*/
|
|
6
|
+
import type { BashProcess } from '@deepseek-ai/dsh-bash';
|
|
7
|
+
/**
|
|
8
|
+
* Map a settled background process onto the generic task-outcome vocabulary:
|
|
9
|
+
* `killed` stays `killed` (detail: the signal when one is known), everything
|
|
10
|
+
* else is `completed` with the exit code as detail. A nonzero command exit is
|
|
11
|
+
* reported, not failed, exactly like the foreground rendering.
|
|
12
|
+
* @param proc - the settled process handle.
|
|
13
|
+
* @returns the outcome for the `ctx.tasks` registration.
|
|
14
|
+
*/
|
|
15
|
+
export declare function processOutcome(proc: BashProcess): {
|
|
16
|
+
status: 'completed' | 'killed';
|
|
17
|
+
detail: string;
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=background.d.ts.map
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Model-facing Consumer of the `ctx.bash` capability seam. Background calls
|
|
3
|
+
* register process handles with `ctx.tasks`; their work uses task cancellation
|
|
4
|
+
* rather than the tool-call signal after an id is returned.
|
|
5
|
+
*
|
|
6
|
+
* TODO(permissions): deployment policy belongs in `tools/pre-execute` and
|
|
7
|
+
* sandboxing executors; see docs/architecture.md § Extending The Harness.
|
|
8
|
+
* @module @deepseek-ai/dsh-tool-bash
|
|
9
|
+
*/
|
|
10
|
+
import type { Context } from '@deepseek-ai/cordis';
|
|
11
|
+
import z from '@deepseek-ai/schemastery';
|
|
12
|
+
export declare const name = "tool-bash";
|
|
13
|
+
export declare const inject: string[];
|
|
14
|
+
/** Configuration for the bash tool. */
|
|
15
|
+
export interface Config {
|
|
16
|
+
/** Expose `run_in_background` (default true); disabled calls are also rejected. */
|
|
17
|
+
enableRunInBackground?: boolean;
|
|
18
|
+
}
|
|
19
|
+
/** Runtime configuration schema for the bash tool plugin. */
|
|
20
|
+
export declare const Config: z<Config>;
|
|
21
|
+
export declare function apply(ctx: Context, config?: Config): void;
|
|
22
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Package-owned invariant companion for `@deepseek-ai/dsh-tool-bash`.
|
|
3
|
+
* @module @deepseek-ai/dsh-tool-bash/invariant
|
|
4
|
+
*/
|
|
5
|
+
import type { Context } from '@deepseek-ai/cordis';
|
|
6
|
+
/** Cordis companion plugin name. */
|
|
7
|
+
export declare const name = "tool-bash-invariant";
|
|
8
|
+
/** Service required before the companion can reserve package ownership. */
|
|
9
|
+
export declare const inject: string[];
|
|
10
|
+
/**
|
|
11
|
+
* Register this package's invariant companion.
|
|
12
|
+
* @param ctx - Cordis context carrying the invariant service.
|
|
13
|
+
* @returns the installed registration's disposer after setup succeeds.
|
|
14
|
+
*/
|
|
15
|
+
export declare const apply: (ctx: Context) => Promise<() => void>;
|
|
16
|
+
//# sourceMappingURL=invariant.d.ts.map
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Model-facing result rendering for the bash tool.
|
|
3
|
+
*
|
|
4
|
+
* @module @deepseek-ai/dsh-tool-bash/render
|
|
5
|
+
*/
|
|
6
|
+
import type { BashProcessRead, BashRunResult, BashSandboxInfo } from '@deepseek-ai/dsh-bash';
|
|
7
|
+
import type { SandboxMode } from '@deepseek-ai/dsh-sandbox';
|
|
8
|
+
/**
|
|
9
|
+
* Shape one finished run into the text the model sees: stdout, then a marked
|
|
10
|
+
* stderr section, then exit-status markers. Non-zero exits are reported, not
|
|
11
|
+
* errored — the model decides how to react; only infrastructure failures
|
|
12
|
+
* (spawn errors, aborts) surface as isError results.
|
|
13
|
+
* @param result - the completed foreground run from the executor.
|
|
14
|
+
* @param escalationModes - the escalation targets this composition advertises;
|
|
15
|
+
* non-empty adds the same-turn escalation hint after a denial marker
|
|
16
|
+
* (default `[]`: no hint).
|
|
17
|
+
* @returns the model-facing text: output body (or `(no output)`), then any timeout/signal/exit markers, each on its own line.
|
|
18
|
+
*/
|
|
19
|
+
export declare function renderResult(result: BashRunResult, escalationModes?: readonly SandboxMode[]): string;
|
|
20
|
+
/**
|
|
21
|
+
* Shape one background-process read into the `task_output` delta the model
|
|
22
|
+
* sees: the incremental delta, plus the lossy-read notice (with full-stream
|
|
23
|
+
* spill paths) when in-memory truncation dropped unread bytes. Empty-delta
|
|
24
|
+
* rendering (`(no new output)`) is the generic control surface's job.
|
|
25
|
+
* @param read - one incremental read from the process handle.
|
|
26
|
+
* @param sandbox - settled sandbox facts, when this was a confined process.
|
|
27
|
+
* @param escalationModes - escalation targets advertised by this composition.
|
|
28
|
+
* @returns the delta text with any loss or sandbox notice appended.
|
|
29
|
+
*/
|
|
30
|
+
export declare function renderProcessRead(read: BashProcessRead, sandbox?: BashSandboxInfo, escalationModes?: readonly SandboxMode[]): string;
|
|
31
|
+
/**
|
|
32
|
+
* The exit-status parse is the shared marker-contract half of the shell-tool
|
|
33
|
+
* rendering story, owned by `@deepseek-ai/dsh-bash` so `dsh-tool-pwsh` reuses
|
|
34
|
+
* it (its renderer emits the same markers). Re-exported here to keep
|
|
35
|
+
* `../src/render.ts` a single import root for bash-tool consumers.
|
|
36
|
+
*/
|
|
37
|
+
export { parseExitStatus, type ParsedExitStatus } from '@deepseek-ai/dsh-bash';
|
|
38
|
+
//# sourceMappingURL=render.d.ts.map
|
package/package.json
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@deepseek-ai/dsh-tool-bash",
|
|
3
|
+
"description": "Model-facing bash tool with optional generic background-task and sandbox-escalation support",
|
|
4
|
+
"version": "0.0.1-rc.1",
|
|
5
|
+
"publishConfig": {
|
|
6
|
+
"access": "restricted"
|
|
7
|
+
},
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "git+https://github.com/deepseek-ai/deepseek-harness.git",
|
|
11
|
+
"directory": "packages/bash/tool-bash"
|
|
12
|
+
},
|
|
13
|
+
"type": "module",
|
|
14
|
+
"main": "lib/index.js",
|
|
15
|
+
"types": "lib/types/index.d.ts",
|
|
16
|
+
"exports": {
|
|
17
|
+
".": {
|
|
18
|
+
"types": "./lib/types/index.d.ts",
|
|
19
|
+
"default": "./lib/index.js"
|
|
20
|
+
},
|
|
21
|
+
"./invariant": {
|
|
22
|
+
"types": "./lib/types/invariant.d.ts",
|
|
23
|
+
"default": "./lib/invariant.js"
|
|
24
|
+
},
|
|
25
|
+
"./src/*": "./src/*",
|
|
26
|
+
"./package.json": "./package.json"
|
|
27
|
+
},
|
|
28
|
+
"files": [
|
|
29
|
+
"lib/index.js",
|
|
30
|
+
"lib/invariant.js",
|
|
31
|
+
"lib/types/**/*.d.ts"
|
|
32
|
+
],
|
|
33
|
+
"license": "BSD-3-Clause",
|
|
34
|
+
"peerDependencies": {
|
|
35
|
+
"@deepseek-ai/dsh-agent": "^0.0.1-rc.1",
|
|
36
|
+
"@deepseek-ai/dsh-bash": "^0.0.1-rc.1",
|
|
37
|
+
"@deepseek-ai/dsh-llm": "^0.0.1-rc.1",
|
|
38
|
+
"@deepseek-ai/dsh-sandbox": "^0.0.1-rc.1",
|
|
39
|
+
"@deepseek-ai/dsh-sandbox-policy": "^0.0.1-rc.1",
|
|
40
|
+
"@deepseek-ai/dsh-system-prompt": "^0.0.1-rc.1",
|
|
41
|
+
"@deepseek-ai/dsh-tasks": "^0.0.1-rc.1",
|
|
42
|
+
"@deepseek-ai/dsh-tools": "^0.0.1-rc.1",
|
|
43
|
+
"@deepseek-ai/dsh-user-approval": "^0.0.1-rc.1",
|
|
44
|
+
"@deepseek-ai/cordis": "^4.0.1-rc.1",
|
|
45
|
+
"@deepseek-ai/dsh-invariants": "^0.0.1-rc.1",
|
|
46
|
+
"@deepseek-ai/dsh-bash-env": "^0.0.1-rc.1"
|
|
47
|
+
},
|
|
48
|
+
"dependencies": {
|
|
49
|
+
"@deepseek-ai/schemastery": "^3.18.1-rc.1"
|
|
50
|
+
},
|
|
51
|
+
"devDependencies": {
|
|
52
|
+
"@deepseek-ai/dsh-agent": "^0.0.1-rc.1",
|
|
53
|
+
"@deepseek-ai/dsh-agent-loop": "^0.0.1-rc.1",
|
|
54
|
+
"@deepseek-ai/dsh-agent-loop-testkit": "^0.0.1-rc.1",
|
|
55
|
+
"@deepseek-ai/dsh-bash": "^0.0.1-rc.1",
|
|
56
|
+
"@deepseek-ai/dsh-bash-env": "^0.0.1-rc.1",
|
|
57
|
+
"@deepseek-ai/dsh-bash-local": "^0.0.1-rc.1",
|
|
58
|
+
"@deepseek-ai/dsh-invariants": "^0.0.1-rc.1",
|
|
59
|
+
"@deepseek-ai/dsh-llm": "^0.0.1-rc.1",
|
|
60
|
+
"@deepseek-ai/dsh-subprocess-local": "^0.0.1-rc.1",
|
|
61
|
+
"@deepseek-ai/dsh-sandbox": "^0.0.1-rc.1",
|
|
62
|
+
"@deepseek-ai/dsh-sandbox-policy": "^0.0.1-rc.1",
|
|
63
|
+
"@deepseek-ai/dsh-session": "^0.0.1-rc.1",
|
|
64
|
+
"@deepseek-ai/dsh-system-prompt": "^0.0.1-rc.1",
|
|
65
|
+
"@deepseek-ai/dsh-tasks": "^0.0.1-rc.1",
|
|
66
|
+
"@deepseek-ai/dsh-tasks-local": "^0.0.1-rc.1",
|
|
67
|
+
"@deepseek-ai/dsh-tool-tasks": "^0.0.1-rc.1",
|
|
68
|
+
"@deepseek-ai/dsh-tools": "^0.0.1-rc.1",
|
|
69
|
+
"@deepseek-ai/dsh-user-approval": "^0.0.1-rc.1",
|
|
70
|
+
"@deepseek-ai/cordis": "^4.0.1-rc.1",
|
|
71
|
+
"@deepseek-ai/dsh-session-persistence-jsonl": "^0.0.1-rc.1"
|
|
72
|
+
}
|
|
73
|
+
}
|