dsh-any-agent
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| DSH_BIN | No | Path to @deepseek-ai/dsh/lib/bin.js. Auto-detected if not set. | |
| DSH_MCP_LOG | No | Log level: silent, info, or debug. | silent |
| DSH_MCP_STATE | No | Conversation registry file that survives restarts. | <repo>/.state/conversations.json |
| DSH_MCP_PROFILE | No | DSH profile to drive. | dsh-mcp |
| DSH_MCP_MAX_LIVE | No | Maximum number of conversation processes to keep alive at once. 0 means unlimited; over the cap the least recently used process is reaped unless a turn is running. | 8 |
| DSH_MCP_RUNS_DIR | No | Root directory for async completion sentinel files named <conversation_id>/<run_id>.json. | <state file dir>/runs |
| DSH_MCP_BOOTSTRAP | No | Whether this server may create or sync the DSH profile on first start. Set to 0 to drive an existing profile only and never write a file. | on |
| DSH_MCP_LOCKS_DIR | No | Directory for write-lock holder registrations. All instances must agree on this value. | <state file dir>/locks |
| DSH_MCP_LOG_STDERR | No | Set to 1 to forward DSH's raw stderr. | |
| DSH_MCP_PERMISSION | No | Default permission tier for dsh_start. | danger-full-access |
| DSH_MCP_IDLE_TTL_MS | No | Idle time before a conversation's DSH process is reaped. 0 means never reap. | 0 |
| DSH_MCP_ROUTE_SOURCE | No | Pin where model routes are copied from during bootstrap: a profile name such as desktop or web, or __home__ for $DSH_HOME/cordis.patch.yml. Unset tries home, desktop, web, headless, then acp. | |
| DSH_MCP_LOCK_STALE_MS | No | Milliseconds without a heartbeat before a lock holder counts as lost. | 90000 |
| DSH_MCP_SENTINEL_TTL_MS | No | Startup pruning age in milliseconds for sentinels. 0 disables pruning. | 604800000 |
| DSH_MCP_REAP_INTERVAL_MS | No | How often in milliseconds the idle reaper checks for conversations to reclaim. Values below the safe floor fall back to the default. | 30000 |
| DSH_MCP_REASONING_EFFORT | No | Default reasoning effort. | max |
| DSH_MCP_LIST_PROBE_TTL_MS | No | Cache lifetime in milliseconds for dsh_list on-disk probing. | 10000 |
| DSH_MCP_PROMPT_TIMEOUT_MS | No | Wait bound in milliseconds for wait=true only. On expiry the turn moves to the background and is not cancelled. | 0 |
| DSH_MCP_REGISTER_WORKSPACE | No | Workspace registration mode: project, all, or 0. | project |
| DSH_MCP_REQUEST_TIMEOUT_MS | No | Per-request timeout in milliseconds on the ACP channel. | 60000 |
| DSH_MCP_APPROVAL_TIMEOUT_MS | No | How long in milliseconds a pending approval waits. | 300000 |
| DSH_MCP_SENTINEL_INCLUDE_REASONING | No | Set to 1 to include result.thinking in sentinel files, breaking the never-on-disk guarantee. |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
This server publishes no instructions, or was last inspected before Glama recorded them.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": false
} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| dsh_startA | 新建一个 DSH 会话(一个可长期共事的编码 agent)。会话活在磁盘上,进程只是缓存;进程被回收或崩溃后会自动用 ACP session/resume 复活,对话不丢。返回 conversation_id 与对话标题。建好后用 dsh_send 派活。 |
| dsh_sendA | 向会话派一个任务。默认不阻塞(wait=false):立即返回 run_id + sentinel_file,回合在后台跑,跑完自动通知你 —— 你继续做别的事,也永远不用担心任务被"超时"打断。想原地等结果就显式传 wait=true(可配 timeout_ms;到期只会转后台,不会取消回合)。【超时不会毁掉任务】wait=true 到达 timeout_ms 仍没跑完时,本工具不会报错、也不会取消回合,而是自动降级为后台:返回 run_id + sentinel_file,回合继续跑完,结果稍后由哨兵文件通知。(timeout_ms=0 表示一直等。)所以任何时候你都能拿到结果,不用怕"超时了白干"。等待模式与后台模式都在回合结束时原子落地一个含最终结果的小文件——推荐用后台任务(Bash run_in_background + |
| dsh_listA | 列出会话及其运行状态,用来掌控多个会话实例。state: running(正在跑回合)/ idle(进程活着但空闲)/ detached(进程没开,可 resume 复活)。running 的会话会带上已跑时长、当前正在执行的工具、本轮已产出字数。数据来自两路合并:本服务持有的 + DSH 磁盘上尚未打开的(DSH 的 session/list 会排除已打开的会话)。想只看正在跑的,传 only_running=true;想看某个会话当前吐出的内容,接着用 dsh_read。 |
| dsh_readA | 读会话的运行期输出(游标式增量)——用它可以看到"正在跑的会话"当前吐出了什么,不必等回合结束。典型用法:dsh_list(only_running) 找到在跑的会话 → 反复 dsh_read 并回传上次的 cursor,就能像切换窗口一样轮流观察多个会话。输出缓冲只在内存里且有界(环形,满则丢最旧),服务/进程退出即消失;思考内容不进缓冲——只有 include_reasoning=true 时才会附带"当前正在跑那一轮"的实时思考。 |
| dsh_getA | 查看单个会话的详情;带 run_id 时取那一次派活的最终结果(异步模式的验收入口)。不传 run_id 则取最近一次回合。返回:标题、工作区、权限档、状态、轮数、token 用量、上下文压力、待决审批,以及该回合的完整结果(正文/工具/用量/错误)。 |
| dsh_interjectA | 插话:会话正在跑某个回合时往里补一句话。两种模式——interject(默认)打断当前回合并立刻改口;queue 不打断,等本轮自然结束后紧接着说。会话空闲时等同于一次普通 dsh_send。说明:ACP 明确拒绝并发 prompt,所以做不到"让模型在同一个回合里即时改向";interject 是它的实用等价物(取消 + 立刻开新回合,历史完整保留)。 |
| dsh_interruptA | 中断会话当前正在进行的回合(ACP 原生 session/cancel,走的就是用户手动按停止那条路径)。会话本身保持完好,可以立刻继续派新任务。 |
| dsh_takeoverA | 抢占会话的写锁(DSH 的写锁是跨进程内核信号量,持有者活着就不过期,没有 API 能直接夺走——唯一手段是杀掉持有者进程,所以本工具会先判定持有者是谁):① 若锁其实空着,正常 resume 即可,不会杀任何东西;② 若持有者是本服务自己留下的孤儿进程(MCP 崩了/重启了,子进程还活着握着锁)→ 自动杀掉并接管,安全;③ 若持有者是另一个活着的 dsh-any-agent 实例 → 默认拒绝,传 force=true 才夺;④ 若持有者无法识别(多半是你自己的 DSH GUI 正开着这个会话)→ 绝不杀(那会连你的界面和正在看的对话一起杀掉),只报告,请你在那个窗口里关掉该会话后重试。注意:杀掉正在跑回合的持有者会中断那一轮(会话日志记为 interrupted),会话本体不受损。 |
| dsh_releaseA | 释放会话占用的 DSH 进程(释放写锁,让用户能在自己的 DSH GUI 里打开同一个会话)。会话本体留在磁盘上,之后仍可 resume;forget=true 才会从注册表里摘掉。★ 用完了想一次性腾内存就传 all=true(默认"永不回收"下每个会话约 300-480MB,全放掉即立刻归零,之后随时 resume)。 |
| dsh_approval_decideA | 裁决一个待决审批(仅当会话的 on_approval=ask 时会出现)。用于把 DSH 的越权/提权请求交给调用方决定,既不一律放行也不一律拒绝。 |
| dsh_statusA | 轻量状态查询:会话是否活着、是否在忙、待决审批数、最近一次回合的结果。 |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
TDQS
Scored across 11 tools
Most tools target clearly distinct operations (start, send, interrupt, release, takeover, approval_decide), but there is real overlap between dsh_get, dsh_status, and dsh_read — all report on a session's state/output — and between dsh_interject (interrupt mode) and dsh_interrupt. The descriptions do disambiguate these (read=cursor-based live output, status=lightweight check, get=full detail/run result), so confusion is limited but not zero.
All names use a consistent dsh_ prefix with snake_case, and 9 of 11 follow a clean verb style (start, send, release, list, read, get, interject, interrupt, takeover). The deviations — dsh_approval_decide (noun_verb) and dsh_status (noun) — are minor and still readable.
11 tools is well within the sweet spot for a session-management server, and each tool maps to a distinct lifecycle concern: create, dispatch, observe, steer, cancel, reclaim, and approve. Nothing feels redundant in count.
The lifecycle is well covered: create, send, list, read, get, interject, interrupt, release (with forget), takeover, and approval handling, plus auto-resume via ACP. Minor gaps: no explicit resume/open tool, no way to change a session's permission profile or on_approval setting after creation, and no delete/purge beyond release+forget.