@amaster.ai/dsh-subagent-filesystem

中文文档
0.1.42发布于 2026/11/07MITTypeScriptES Module近 30 天下载 3018

Discover Markdown specialist roles through the DSH filesystem and delegate through native in-process subagents.

原始使用文档
文档目录4 节
  1. Install and configure
  2. Definition format
  3. Delegation
  4. Tests

dsh-subagent-filesystem

Markdown roles for dsh

dsh-subagent-filesystem preview

Discover specialist roles from the agent workspace's agents/*.md and expose named delegation tools. Each Markdown body becomes a separate child system section, preserving Harness instructions, the application persona, and native permissions. The delegated task remains user content. Files are read exclusively through the caller's scoped ctx.fs, including remote and sandbox providers, with no host-filesystem fallback.

Install and configure

dsh plugin --profile my-agent add @amaster.ai/dsh-subagent-filesystem

Enable the bundle in the profile's cordis.patch.yml:

- id: subagent-filesystem
  config:
    enabled: true
    root: agents

Disabled by default. root defaults to agents, relative to the agent's initial workspace directory; sandbox deployments can explicitly select /agents. Discovery scans direct *.md children only. A missing root produces an empty catalog. Files are loaded when the agent is created; create a new agent to pick up changes. Watching and hot reload are outside the initial scope.

Requires the fs, tools, subagents, systemPrompt, and sessionQuery services, plus the native in-process provider registered as spawn. The standard headless profile supplies these capabilities. DSH peer floor: >=0.2.1-rc.2 || >=0.2.2-rc.1; tested DSH: 0.2.2-rc.1; tested Cordis: 4.1.0. This version uses managed activations and requires DSH 0.2.1-rc.2 or newer; use plugin v0.1.27 with DSH 0.2.0.

Definition format

agents/inventory-analyst.md:

---
name: inventory-analyst
description: Investigate inventory discrepancies and explain their causes.
---
You are the inventory analyst. Compare posted movements with current balances,
identify discrepancies, and report evidence before recommending changes.
Read references/inventory-rules.md relative to this definition before analysis.

Only name and description are supported in YAML frontmatter. Names must be lowercase kebab-case, start with a letter, and contain at most 55 characters. Description and body must be nonempty. Definitions must be valid UTF-8 and at most 1 MiB. Unsupported fields, duplicate YAML keys, duplicate role names, and tool-name collisions fail that agent's catalog load with a [dsh-subagent-filesystem] error. No partial catalog is published; existing application tools are preserved.

{{…}} in the body stays literal. Child instructions include the definition's resource directory. The child opens supporting references, scripts, and assets with its own tools, resolving relative paths against that directory. This plugin does not download or execute resources.

Delegation

The example exposes subagent_inventory_analyst; its description tells the parent when to delegate.

ParameterMeaning
promptRequired: a complete, self-contained task delivered as the child's user message
descriptionRequired: the native subagent's short task label
run_in_backgroundDefault false: wait for a report; true: return a continuable child id

Background children use native completion notifications and send_message for follow-up. Native subagent services retain model defaults, delegation depth, sandbox boundaries, and approval rules. Definition files cannot override models, tools, or permissions. Foreground failures become tool errors; accepted runs always reach native cleanup.

Named tools belong only to the consuming parent agent. They do not leak into other agents or workspaces, or automatically copy to children. A subagent-filesystem/role session event stores the child's role instructions and resource path. Cold restoration reinstalls the original snapshot rather than changing an existing role when its source file changes. Protect these instruction snapshots through the consuming application's existing session storage and access controls.

Unloading cancels outstanding delegations, removes registrations and listeners, and releases background children started by the plugin. Role restoration requires the plugin to remain enabled. The initial version supports native in-process spawn; external ACP/Codex/Claude providers and application configuration downloads are outside its scope.

Tests

pnpm --filter @amaster.ai/dsh-subagent-filesystem test
pnpm --filter @amaster.ai/dsh-subagent-filesystem typecheck
pnpm --filter @amaster.ai/dsh-subagent-filesystem build

.github/scripts/integration/dsh-subagent-filesystem.mjs automatically joins the repository E2E matrix. It installs the packed bundle, starts real dsh, delegates through the integration model, and verifies the actual child system instructions, user task, and resource-file evidence. A local forwarding gateway inspects protocol requests, so system/user separation is verified independently of the model's claims.

Required: DSH_PKG_TARBALL, DSH_INTEGRATION_BASE_URL, and DSH_INTEGRATION_API_KEY. Optional: DSH_CLI, DSH_HOME, and DSH_INTEGRATION_MODEL. For local development, set DSH_SUBAGENT_E2E_FAKE=1 to use deterministic Messages responses while still running real dsh, native children, and file tools. This mode does not validate real-model behavior.

版本与发布记录

@amaster.ai/dsh-subagent-filesystem 共发布 21 个版本,首次发布于 2026/10/14;过去 12 个月发布了 21 个版本。

版本发布日期距今
0.1.42latest2026/11/07今天
0.1.412026/11/061 天前
0.1.402026/11/043 天前
0.1.392026/11/043 天前
0.1.382026/10/317 天前
0.1.372026/10/317 天前

关于 @amaster.ai/dsh-subagent-filesystem 的常见问题

@amaster.ai/dsh-subagent-filesystem 是什么?

Discover Markdown specialist roles through the DSH filesystem and delegate through native in-process subagents.

如何安装 @amaster.ai/dsh-subagent-filesystem?

在项目目录运行 npm install @amaster.ai/dsh-subagent-filesystem,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:@deepseek-ai/cordis(^4.0.4)、@deepseek-ai/dsh-fs(>=0.2.0-rc.1 || >=0.2.1-rc.1 || >=0.2.2-rc.1)、@deepseek-ai/dsh-agent(>=0.2.0-rc.1 || >=0.2.1-rc.1 || >=0.2.2-rc.1)、@deepseek-ai/dsh-tools(>=0.2.0-rc.1 || >=0.2.1-rc.1 || >=0.2.2-rc.1)、@deepseek-ai/dsh-session(>=0.2.0-rc.1 || >=0.2.1-rc.1 || >=0.2.2-rc.1)、@deepseek-ai/dsh-subagent(>=0.2.1-rc.2 || >=0.2.2-rc.1)、@deepseek-ai/dsh-session-query(>=0.2.0-rc.1 || >=0.2.1-rc.1 || >=0.2.2-rc.1)、@deepseek-ai/dsh-system-prompt(>=0.2.0-rc.1 || >=0.2.1-rc.1 || >=0.2.2-rc.1)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@amaster.ai/dsh-subagent-filesystem 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@amaster.ai/dsh-subagent-filesystem 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@amaster.ai/dsh-subagent-filesystem 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js ^20.19 || ^22.12 || >=24.0。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@amaster.ai/dsh-subagent-filesystem 可以商用吗?

@amaster.ai/dsh-subagent-filesystem 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@amaster.ai/dsh-subagent-filesystem 的下载量有多少?

根据 npm 官方下载统计,@amaster.ai/dsh-subagent-filesystem 在 2026/10/06 – 2026/11/04 这 30 天内被下载 3,018 次,日均约 101 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@amaster.ai/dsh-subagent-filesystem 还在维护吗?

最新版本 0.1.42 发布于 2026/11/07(今天);至今共发布 21 个版本,其中过去 12 个月发布了 21 个;首次发布于 2026/10/14。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。