dsh-plugin-dev-kb 1.0.0 → 1.0.2
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/README.md +60 -9
- package/kb/INDEX.md +1 -1
- package/kb/README.md +22 -11
- package/kb/extra/development.md +2 -0
- package/kb/extra/development.zh.md +2 -0
- package/kb/extra/event-producer-consumer.md +9 -9
- package/kb/extra/event-producer-consumer.zh.md +9 -9
- package/kb/extra/i18n/README.md +1 -1
- package/kb/extra/i18n/README.zh.md +1 -1
- package/kb/extra/module-graph.md +251 -210
- package/kb/extra/module-graph.zh.md +251 -210
- package/kb/extra/subsystems/agent-team.md +183 -0
- package/kb/extra/subsystems/agent-team.zh.md +183 -0
- package/kb/extra/subsystems/attachment.md +16 -2
- package/kb/extra/subsystems/attachment.zh.md +16 -2
- package/kb/meta/search-index.json +54 -42
- package/kb/meta/source.json +3 -3
- package/kb/meta/topics.md +1 -1
- package/kb/site/en/guide/providers.md +40 -1
- package/kb/site/en/reference/capability-seams.md +12 -0
- package/kb/site/en/reference/config-catalog.md +238 -72
- package/kb/site/en/reference/index.md +2 -0
- package/kb/site/en/reference/persistence-catalog.md +76 -13
- package/kb/site/en/reference/subsystems/client-modules.md +11 -3
- package/kb/site/en/reference/subsystems/commands.md +28 -5
- package/kb/site/en/reference/subsystems/index.md +1 -0
- package/kb/site/en/reference/subsystems/llm-streaming.md +11 -2
- package/kb/site/en/reference/subsystems/persistence.md +3 -3
- package/kb/site/en/reference/subsystems/plan.md +1 -1
- package/kb/site/en/reference/subsystems/session-reference.md +71 -5
- package/kb/site/en/reference/subsystems/session.md +6 -2
- package/kb/site/en/reference/subsystems/subagent.md +22 -3
- package/kb/site/en/reference/subsystems/web.md +5 -4
- package/kb/site/en/reference/tool-catalog.md +353 -5
- package/kb/site/guide/providers.md +40 -1
- package/kb/site/reference/capability-seams.md +12 -0
- package/kb/site/reference/config-catalog.md +252 -86
- package/kb/site/reference/index.md +2 -0
- package/kb/site/reference/persistence-catalog.md +76 -13
- package/kb/site/reference/subsystems/client-modules.md +11 -3
- package/kb/site/reference/subsystems/commands.md +28 -5
- package/kb/site/reference/subsystems/index.md +1 -0
- package/kb/site/reference/subsystems/llm-streaming.md +11 -2
- package/kb/site/reference/subsystems/persistence.md +3 -3
- package/kb/site/reference/subsystems/plan.md +1 -1
- package/kb/site/reference/subsystems/session-reference.md +71 -5
- package/kb/site/reference/subsystems/session.md +6 -2
- package/kb/site/reference/subsystems/subagent.md +22 -3
- package/kb/site/reference/subsystems/web.md +5 -4
- package/kb/site/reference/tool-catalog.md +352 -5
- package/lib/index.js +113 -0
- package/package.json +14 -2
- package/scripts/rebuild-index.mjs +2 -1
- package/scripts/selfcheck.mjs +30 -0
- package/skills/dsh-plugin-dev-kb.md +2 -2
|
@@ -26,6 +26,7 @@ editSource: "docs/tool-catalog.zh.md"
|
|
|
26
26
|
| `@deepseek-ai/dsh-tool-pwsh` | `pwsh` | `ctx.tools`、`ctx.shell`、`ctx.systemPrompt`、`ctx.shellEnv`、`ctx.jobs at call time for run_in_background` | `tool/call`、`tool/result` | - | pwsh 工具是 Windows 组合中 bash 执行器 seam 的 PowerShell 方言消费方(由 `@deepseek-ai/dsh-pwsh-local` 等 PowerShell 执行器为 `ctx.shell` 提供后端);除沙箱接口外,它逐项对应 bash 工具调用。使用 `run_in_background` 的运行会注册到通用 `ctx.jobs` 运行时,并通过 `job_*` 工具收集/停止;托管的 `DSH_*` 环境来自 `@deepseek-ai/dsh-shell-env`。每次调用都在新进程中运行,不使用持久 PTY 会话。路径采用原生 `C:\...` 形式,变量采用 `$env:NAME`。 |
|
|
27
27
|
| `@deepseek-ai/dsh-tool-cordis` | `cordis_define`、`cordis_inspect_list`、`cordis_inspect_query`、`cordis_inspect_self`、`cordis_run`、`cordis_stop`、`cordis_undefine` | `ctx.tools`、`ctx.dynamicCordisRunner` | `tool/call`、`tool/result`、`process-local dynamic package lifecycle` | - | 不在任何随产品发布的树中,需要显式选择启用;动态 Package 代码可以访问真实运行时,见 .agents/notes/implemented/feature/2026-07-08-self-referential-cordis-toolset.md。该工具集注入 `@deepseek-ai/dsh-cordis-host-runner` 提供的 `ctx.dynamicCordisRunner`,后者拥有定义注册表和 vm 沙箱;组合缺少它时这些工具不会激活。运行中的 Package 在停止、undefine 或 DSH 重启前可以注册**额外的**模型可见工具;发生这类工具集变化时,系统会记录完整且有变动的请求头。 |
|
|
28
28
|
| `@deepseek-ai/dsh-tool-bash-persistent` | `bash` | `ctx.tools`、`ctx.terminals`、`an owning Agent at execution time` | `tool/call`、`PTY shell state`、`tool/result` | - | 一个按所有者隔离的持久 bash 工具;部署组合提供 PTY 后端,并可覆盖面向模型的环境描述。 |
|
|
29
|
+
| `@deepseek-ai/dsh-tool-pwsh-persistent` | `pwsh` | `ctx.tools`、`ctx.terminals`、`an owning Agent at execution time` | `tool/call`、`PTY shell state`、`tool/result` | - | 一个按所有者隔离的持久 pwsh 工具,持久 bash 工具的 Windows 对应物;部署组合提供 pwsh 方言的 PTY 后端,并可覆盖面向模型的环境描述。 |
|
|
29
30
|
| `@deepseek-ai/dsh-tool-str-replace-editor` | `str_replace_editor` | `ctx.tools`、`ctx.fs` | `tool/call`、`fs/observed after view presence/absence, edit absence, or successful mutation`、`tool/result` | - | 基于文件系统 seam 的独立查看/创建/唯一字面量替换/按行插入工具;可与任何 shell 或终端接口组合。 |
|
|
30
31
|
| `@deepseek-ai/dsh-tool-fs` | `edit`、`read`、`read_image`、`write` | `ctx.tools`、`ctx.fs`、`ctx.systemPrompt`、`ctx.attachments (read_image registration)`、`ctx.llm + an image-capable route (read_image execution)` | `tool/call`、`fs/write-intent or fs/edit-intent for mutations`、`fs/observed after read presence/absence or successful file operation`、`durable attachment (read_image)`、`tool/result` | - | 先读后写/编辑策略由 `@deepseek-ai/dsh-fs-observation-policy` 添加;它是一个 `fs/*` 事件门禁插件,不会改变 schema。加载这些工具的部署按预期也应加载该插件。没有 `ctx.attachments` 时 `read_image` 不会注册;其 schema 与路由无关,执行时除非确切路由的模型声明图像输入,否则拒绝。 |
|
|
31
32
|
| `@deepseek-ai/dsh-tool-fs-search` | `glob`、`grep` | `ctx.tools`、`ctx.subprocess`、`ctx.systemPrompt` | `tool/call`、`tool/result` | - | glob 和 grep 是无条件可用的发现工具,通过 ctx.subprocess spawn 随包提供的 ripgrep 二进制文件(`@vscode/ripgrep`),并作为普通前台调用运行,绝不作为后台任务;无需在宿主机安装 `rg`,也不经过 shell 层。本目录使用 `sampleOverCapGlobResults: true`;部署必须显式选择该行为。结果超过上限时,会通过可选的 ctx.spillStore 后端保存完整的格式化列表;在共置部署中,如果后端公开本地路径,返回的定位信息可供后续读取/搜索。 |
|
|
@@ -40,6 +41,7 @@ editSource: "docs/tool-catalog.zh.md"
|
|
|
40
41
|
| `@deepseek-ai/dsh-tool-subagent-control` | `interrupt_agent`、`list_agents`、`send_message` | `ctx.tools`、`ctx.subagents`、`ctx.agents and ctx.sessionProjections (list_agents only)` | `tool/call`、`tool/result`、`child session events through ctx.subagents` | - | 这些是控制可继续后台 subagent 的全局命名工具:绑定提供方的 `tool-subagent` 实例注册不同的委派工具;本包注册一次 `send_message` 和 `interrupt_agent`,另由 `list_agents` 通过单独加载的 `/list-agents` 插件提供,其目录行使用 sessionProjections 和实时 Agent 注册表。 |
|
|
41
42
|
| `@deepseek-ai/dsh-tool-subagent-report` | `report` | `ctx.subagents`、`ctx.systemPrompt`、`a live continuable in-process child Agent` | `tool/call`、`tool/result`、`a user-role message in the direct parent session` | - | 按可继续的进程内子级注册,而非全局注册,因此该 schema 仅在这种子级内部可见,并且不受其全局 `toolFilter` 影响。同一份贡献还会安装子级作用域的 `tool:report` 系统提示词 section,本目录不渲染该 section。面向父级的 `send_message` 工具单独安装。 |
|
|
42
43
|
| `@deepseek-ai/dsh-tool-jobs` | `job_kill`、`job_list`、`job_output` | `ctx.tools`、`ctx.jobs`、`ctx.systemPrompt` | `tool/call`、`tool/result`、`user/message via agent.inject() for background completion notices` | - | 与任务种类无关的后台任务控制器:后台 bash 命令、PTY 发送和 subagent 都通过相同的 3 个工具读取、列出和终止。加载该插件会挂接控制器,从而启用生产方的 `ctx.jobs.start()`。 |
|
|
44
|
+
| `@deepseek-ai/dsh-experimental-tool-agent-team` | `followup_task`、`interrupt_agent`、`list_agents`、`send_message`、`spawn_teammate`、`team_task_create`、`team_task_get`、`team_task_list`、`team_task_update`、`wait_agent` | `ctx.tools`、`ctx.systemPrompt`、`ctx.agentTeams`、`an exact live Team member Agent` | `tool/call`、`team/member`、`team/message/queued`、`team/message/delivered`、`team/task`、`tool/result` | - | 这 10 个工具限定于隐式 Team Lead 与持久 teammate 作用域。随产品发布的 dsh-base bundle 默认禁用该包;文档中的 Agent Teams profile patch 会启用它,并禁用旧 continuable child 的同名控制工具。 |
|
|
43
45
|
| `@deepseek-ai/dsh-tool-todo` | `todo_write` | `ctx.tools`、`owning Agent session` | `tool/call`、`todo/write`、`tool/result` | - | todo_write 是会话所有的状态;UI 将最新的 todo/write 事件渲染为检查清单。`allowParallelInProgress` 是没有默认值的必填项,因此本目录明确选择 `true`,对应描述允许同时存在多个 `in_progress` 项。选择 `false` 的部署会获得同一工具,但描述会要求只能有 1 个活动任务。 |
|
|
44
46
|
| `@deepseek-ai/dsh-tool-workflow` | `workflow` | `ctx.tools`、`ctx.workflowEngine`、`ctx.systemPrompt`、`a calling Agent (exec.agent parents the script children)` | `tool/call`、`tool/result` | - | - |
|
|
45
47
|
| `@deepseek-ai/dsh-tool-web` | `web_fetch`、`web_search` | `ctx.tools`、`ctx.web`、`ctx.systemPrompt` | `tool/call`、`tool/result` | - | web_search 和 web_fetch 将提供方选择置于 ctx.web 之后,使模型可见 schema 在更换后端时保持稳定。 |
|
|
@@ -530,6 +532,33 @@ pwsh 工具是 Windows 组合中 bash 执行器 seam 的 PowerShell 方言消费
|
|
|
530
532
|
|
|
531
533
|
一个按所有者隔离的持久 bash 工具;部署组合提供 PTY 后端,并可覆盖面向模型的环境描述。
|
|
532
534
|
|
|
535
|
+
<a id="deepseek-aidsh-tool-pwsh-persistent"></a>
|
|
536
|
+
|
|
537
|
+
## `@deepseek-ai/dsh-tool-pwsh-persistent`
|
|
538
|
+
|
|
539
|
+
### `pwsh`
|
|
540
|
+
|
|
541
|
+
在持久 PowerShell shell 中运行命令。包括当前目录和已导出环境变量在内的状态会在此 agent 的多次调用之间保留。
|
|
542
|
+
|
|
543
|
+
```json
|
|
544
|
+
{
|
|
545
|
+
"type": "object",
|
|
546
|
+
"properties": {
|
|
547
|
+
"command": {
|
|
548
|
+
"type": "string",
|
|
549
|
+
"description": "The PowerShell command to run. Relative path is preferred in the command."
|
|
550
|
+
}
|
|
551
|
+
},
|
|
552
|
+
"required": [
|
|
553
|
+
"command"
|
|
554
|
+
]
|
|
555
|
+
}
|
|
556
|
+
```
|
|
557
|
+
|
|
558
|
+
来源:[`packages/shell/tool-pwsh-persistent/src/index.ts`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/shell/tool-pwsh-persistent/src/index.ts)
|
|
559
|
+
|
|
560
|
+
一个按所有者隔离的持久 pwsh 工具,持久 bash 工具的 Windows 对应物;部署组合提供 pwsh 方言的 PTY 后端,并可覆盖面向模型的环境描述。
|
|
561
|
+
|
|
533
562
|
<a id="deepseek-aidsh-tool-str-replace-editor"></a>
|
|
534
563
|
|
|
535
564
|
## `@deepseek-ai/dsh-tool-str-replace-editor`
|
|
@@ -1687,6 +1716,321 @@ lsp 工具将提供方选择和语言服务器子进程置于 ctx.lsp 之后,
|
|
|
1687
1716
|
|
|
1688
1717
|
<a id="deepseek-aidsh-tool-todo"></a>
|
|
1689
1718
|
|
|
1719
|
+
## `@deepseek-ai/dsh-experimental-tool-agent-team`
|
|
1720
|
+
|
|
1721
|
+
### `followup_task`
|
|
1722
|
+
|
|
1723
|
+
向另一名 Team member 发送持久 follow-up task,并在需要时启动一个 turn。
|
|
1724
|
+
|
|
1725
|
+
```json
|
|
1726
|
+
{
|
|
1727
|
+
"type": "object",
|
|
1728
|
+
"properties": {
|
|
1729
|
+
"target": {
|
|
1730
|
+
"type": "string",
|
|
1731
|
+
"description": "Team member name, or lead."
|
|
1732
|
+
},
|
|
1733
|
+
"message": {
|
|
1734
|
+
"type": "string",
|
|
1735
|
+
"description": "Self-contained message for the target."
|
|
1736
|
+
}
|
|
1737
|
+
},
|
|
1738
|
+
"required": [
|
|
1739
|
+
"target",
|
|
1740
|
+
"message"
|
|
1741
|
+
]
|
|
1742
|
+
}
|
|
1743
|
+
```
|
|
1744
|
+
|
|
1745
|
+
来源:[`packages/experimental/tool-agent-team/src/index.ts`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/experimental/tool-agent-team/src/index.ts)
|
|
1746
|
+
|
|
1747
|
+
### `interrupt_agent`
|
|
1748
|
+
|
|
1749
|
+
中断一名 teammate 的当前 turn,同时保留其待处理 inbox。仅 Team Lead 可用。
|
|
1750
|
+
|
|
1751
|
+
```json
|
|
1752
|
+
{
|
|
1753
|
+
"type": "object",
|
|
1754
|
+
"properties": {
|
|
1755
|
+
"target": {
|
|
1756
|
+
"type": "string",
|
|
1757
|
+
"description": "Teammate name."
|
|
1758
|
+
}
|
|
1759
|
+
},
|
|
1760
|
+
"required": [
|
|
1761
|
+
"target"
|
|
1762
|
+
]
|
|
1763
|
+
}
|
|
1764
|
+
```
|
|
1765
|
+
|
|
1766
|
+
来源:[`packages/experimental/tool-agent-team/src/index.ts`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/experimental/tool-agent-team/src/index.ts)
|
|
1767
|
+
|
|
1768
|
+
### `list_agents`
|
|
1769
|
+
|
|
1770
|
+
列出 Lead 与所有持久 teammate,以及各自当前的运行时状态。
|
|
1771
|
+
|
|
1772
|
+
```json
|
|
1773
|
+
{
|
|
1774
|
+
"type": "object",
|
|
1775
|
+
"properties": {}
|
|
1776
|
+
}
|
|
1777
|
+
```
|
|
1778
|
+
|
|
1779
|
+
来源:[`packages/experimental/tool-agent-team/src/index.ts`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/experimental/tool-agent-team/src/index.ts)
|
|
1780
|
+
|
|
1781
|
+
### `send_message`
|
|
1782
|
+
|
|
1783
|
+
向另一名 Team member 发送持久信息,但不启动 idle member。
|
|
1784
|
+
|
|
1785
|
+
```json
|
|
1786
|
+
{
|
|
1787
|
+
"type": "object",
|
|
1788
|
+
"properties": {
|
|
1789
|
+
"target": {
|
|
1790
|
+
"type": "string",
|
|
1791
|
+
"description": "Team member name, or lead."
|
|
1792
|
+
},
|
|
1793
|
+
"message": {
|
|
1794
|
+
"type": "string",
|
|
1795
|
+
"description": "Self-contained message for the target."
|
|
1796
|
+
}
|
|
1797
|
+
},
|
|
1798
|
+
"required": [
|
|
1799
|
+
"target",
|
|
1800
|
+
"message"
|
|
1801
|
+
]
|
|
1802
|
+
}
|
|
1803
|
+
```
|
|
1804
|
+
|
|
1805
|
+
来源:[`packages/experimental/tool-agent-team/src/index.ts`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/experimental/tool-agent-team/src/index.ts)
|
|
1806
|
+
|
|
1807
|
+
### `spawn_teammate`
|
|
1808
|
+
|
|
1809
|
+
创建一名具名、持久的 teammate。只有 Team Lead 可以调用此工具。
|
|
1810
|
+
|
|
1811
|
+
```json
|
|
1812
|
+
{
|
|
1813
|
+
"type": "object",
|
|
1814
|
+
"properties": {
|
|
1815
|
+
"name": {
|
|
1816
|
+
"type": "string",
|
|
1817
|
+
"description": "Unique lower-kebab-case teammate name."
|
|
1818
|
+
},
|
|
1819
|
+
"description": {
|
|
1820
|
+
"type": "string",
|
|
1821
|
+
"description": "Short description of the delegated responsibility."
|
|
1822
|
+
},
|
|
1823
|
+
"prompt": {
|
|
1824
|
+
"type": "string",
|
|
1825
|
+
"description": "Complete initial task for the teammate."
|
|
1826
|
+
},
|
|
1827
|
+
"context": {
|
|
1828
|
+
"type": "string",
|
|
1829
|
+
"description": "fresh starts without Lead history; fork inherits completed Lead turns. Defaults to fresh.",
|
|
1830
|
+
"enum": [
|
|
1831
|
+
"fresh",
|
|
1832
|
+
"fork"
|
|
1833
|
+
]
|
|
1834
|
+
}
|
|
1835
|
+
},
|
|
1836
|
+
"required": [
|
|
1837
|
+
"name",
|
|
1838
|
+
"description",
|
|
1839
|
+
"prompt"
|
|
1840
|
+
]
|
|
1841
|
+
}
|
|
1842
|
+
```
|
|
1843
|
+
|
|
1844
|
+
来源:[`packages/experimental/tool-agent-team/src/index.ts`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/experimental/tool-agent-team/src/index.ts)
|
|
1845
|
+
|
|
1846
|
+
### `team_task_create`
|
|
1847
|
+
|
|
1848
|
+
在共享 Team 任务板上创建一个无 owner 的 pending task。
|
|
1849
|
+
|
|
1850
|
+
```json
|
|
1851
|
+
{
|
|
1852
|
+
"type": "object",
|
|
1853
|
+
"properties": {
|
|
1854
|
+
"subject": {
|
|
1855
|
+
"type": "string",
|
|
1856
|
+
"description": "Concise task title."
|
|
1857
|
+
},
|
|
1858
|
+
"description": {
|
|
1859
|
+
"type": "string",
|
|
1860
|
+
"description": "Complete task details and acceptance criteria."
|
|
1861
|
+
},
|
|
1862
|
+
"blocked_by": {
|
|
1863
|
+
"type": "array",
|
|
1864
|
+
"description": "Task ids that must complete first.",
|
|
1865
|
+
"items": {
|
|
1866
|
+
"type": "string"
|
|
1867
|
+
}
|
|
1868
|
+
},
|
|
1869
|
+
"write_scopes": {
|
|
1870
|
+
"type": "array",
|
|
1871
|
+
"description": "Advisory workspace-relative file or directory prefixes this task expects to modify.",
|
|
1872
|
+
"items": {
|
|
1873
|
+
"type": "string"
|
|
1874
|
+
}
|
|
1875
|
+
}
|
|
1876
|
+
},
|
|
1877
|
+
"required": [
|
|
1878
|
+
"subject",
|
|
1879
|
+
"description"
|
|
1880
|
+
]
|
|
1881
|
+
}
|
|
1882
|
+
```
|
|
1883
|
+
|
|
1884
|
+
来源:[`packages/experimental/tool-agent-team/src/index.ts`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/experimental/tool-agent-team/src/index.ts)
|
|
1885
|
+
|
|
1886
|
+
### `team_task_get`
|
|
1887
|
+
|
|
1888
|
+
在修改或执行共享任务前,读取其完整的最新值。
|
|
1889
|
+
|
|
1890
|
+
```json
|
|
1891
|
+
{
|
|
1892
|
+
"type": "object",
|
|
1893
|
+
"properties": {
|
|
1894
|
+
"task_id": {
|
|
1895
|
+
"type": "string",
|
|
1896
|
+
"description": "Shared task id."
|
|
1897
|
+
}
|
|
1898
|
+
},
|
|
1899
|
+
"required": [
|
|
1900
|
+
"task_id"
|
|
1901
|
+
]
|
|
1902
|
+
}
|
|
1903
|
+
```
|
|
1904
|
+
|
|
1905
|
+
来源:[`packages/experimental/tool-agent-team/src/index.ts`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/experimental/tool-agent-team/src/index.ts)
|
|
1906
|
+
|
|
1907
|
+
### `team_task_list`
|
|
1908
|
+
|
|
1909
|
+
列出共享任务,包括 readiness、owner、revision、blocker 与 write-scope warning。
|
|
1910
|
+
|
|
1911
|
+
```json
|
|
1912
|
+
{
|
|
1913
|
+
"type": "object",
|
|
1914
|
+
"properties": {
|
|
1915
|
+
"status": {
|
|
1916
|
+
"type": "string",
|
|
1917
|
+
"description": "Optional exact status filter.",
|
|
1918
|
+
"enum": [
|
|
1919
|
+
"pending",
|
|
1920
|
+
"in_progress",
|
|
1921
|
+
"completed"
|
|
1922
|
+
]
|
|
1923
|
+
},
|
|
1924
|
+
"owner": {
|
|
1925
|
+
"type": "string",
|
|
1926
|
+
"description": "Optional member-name filter; use unowned for tasks without an owner."
|
|
1927
|
+
},
|
|
1928
|
+
"ready": {
|
|
1929
|
+
"type": "boolean",
|
|
1930
|
+
"description": "Optional readiness filter."
|
|
1931
|
+
},
|
|
1932
|
+
"cursor": {
|
|
1933
|
+
"type": "integer",
|
|
1934
|
+
"description": "Zero-based result offset. Defaults to 0."
|
|
1935
|
+
},
|
|
1936
|
+
"limit": {
|
|
1937
|
+
"type": "integer",
|
|
1938
|
+
"description": "Number of rows, 1 through 100. Defaults to 50."
|
|
1939
|
+
}
|
|
1940
|
+
}
|
|
1941
|
+
}
|
|
1942
|
+
```
|
|
1943
|
+
|
|
1944
|
+
来源:[`packages/experimental/tool-agent-team/src/index.ts`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/experimental/tool-agent-team/src/index.ts)
|
|
1945
|
+
|
|
1946
|
+
### `team_task_update`
|
|
1947
|
+
|
|
1948
|
+
使用 team_task_get 或 team_task_list 返回的最新 revision,对共享任务操作执行 compare-and-set。
|
|
1949
|
+
|
|
1950
|
+
```json
|
|
1951
|
+
{
|
|
1952
|
+
"type": "object",
|
|
1953
|
+
"properties": {
|
|
1954
|
+
"task_id": {
|
|
1955
|
+
"type": "string",
|
|
1956
|
+
"description": "Shared task id."
|
|
1957
|
+
},
|
|
1958
|
+
"expected_revision": {
|
|
1959
|
+
"type": "integer",
|
|
1960
|
+
"description": "Current task revision used as the CAS precondition."
|
|
1961
|
+
},
|
|
1962
|
+
"action": {
|
|
1963
|
+
"type": "string",
|
|
1964
|
+
"description": "Task transition to apply.",
|
|
1965
|
+
"enum": [
|
|
1966
|
+
"claim",
|
|
1967
|
+
"release",
|
|
1968
|
+
"edit",
|
|
1969
|
+
"set_dependencies",
|
|
1970
|
+
"complete",
|
|
1971
|
+
"reopen",
|
|
1972
|
+
"reassign",
|
|
1973
|
+
"delete"
|
|
1974
|
+
]
|
|
1975
|
+
},
|
|
1976
|
+
"subject": {
|
|
1977
|
+
"type": "string",
|
|
1978
|
+
"description": "Replacement title for edit."
|
|
1979
|
+
},
|
|
1980
|
+
"description": {
|
|
1981
|
+
"type": "string",
|
|
1982
|
+
"description": "Replacement details for edit."
|
|
1983
|
+
},
|
|
1984
|
+
"blocked_by": {
|
|
1985
|
+
"type": "array",
|
|
1986
|
+
"description": "Complete blocker list for set_dependencies.",
|
|
1987
|
+
"items": {
|
|
1988
|
+
"type": "string"
|
|
1989
|
+
}
|
|
1990
|
+
},
|
|
1991
|
+
"write_scopes": {
|
|
1992
|
+
"type": "array",
|
|
1993
|
+
"description": "Replacement advisory write scopes for edit.",
|
|
1994
|
+
"items": {
|
|
1995
|
+
"type": "string"
|
|
1996
|
+
}
|
|
1997
|
+
},
|
|
1998
|
+
"owner": {
|
|
1999
|
+
"type": "string",
|
|
2000
|
+
"description": "Member name for Lead-only reassign; omit to unassign."
|
|
2001
|
+
}
|
|
2002
|
+
},
|
|
2003
|
+
"required": [
|
|
2004
|
+
"task_id",
|
|
2005
|
+
"expected_revision",
|
|
2006
|
+
"action"
|
|
2007
|
+
]
|
|
2008
|
+
}
|
|
2009
|
+
```
|
|
2010
|
+
|
|
2011
|
+
来源:[`packages/experimental/tool-agent-team/src/index.ts`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/experimental/tool-agent-team/src/index.ts)
|
|
2012
|
+
|
|
2013
|
+
### `wait_agent`
|
|
2014
|
+
|
|
2015
|
+
等待本次调用开始后下一次 teammate 状态、mailbox 或共享任务变更。它绝不会唤醒 inactive member;若没有其他 member 正在 running 或 provisioning,则立即返回 noProgress。唤醒或超时后应重新列出状态,而不是轮询。
|
|
2016
|
+
|
|
2017
|
+
```json
|
|
2018
|
+
{
|
|
2019
|
+
"type": "object",
|
|
2020
|
+
"properties": {
|
|
2021
|
+
"timeout_ms": {
|
|
2022
|
+
"type": "integer",
|
|
2023
|
+
"description": "Wait duration in milliseconds, from 10000 through 3600000. Defaults to 30000."
|
|
2024
|
+
}
|
|
2025
|
+
}
|
|
2026
|
+
}
|
|
2027
|
+
```
|
|
2028
|
+
|
|
2029
|
+
来源:[`packages/experimental/tool-agent-team/src/index.ts`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/experimental/tool-agent-team/src/index.ts)
|
|
2030
|
+
|
|
2031
|
+
这 10 个工具限定于隐式 Team Lead 与持久 teammate 作用域。随产品发布的 dsh-base bundle 默认禁用该包;文档中的 Agent Teams profile patch 会启用它,并禁用旧 continuable child 的同名控制工具。
|
|
2032
|
+
|
|
2033
|
+
|
|
1690
2034
|
## `@deepseek-ai/dsh-tool-todo`
|
|
1691
2035
|
|
|
1692
2036
|
### `todo_write`
|
|
@@ -1858,19 +2202,22 @@ todo_write 是会话所有的状态;UI 将最新的 todo/write 事件渲染为
|
|
|
1858
2202
|
|
|
1859
2203
|
### `web_search`
|
|
1860
2204
|
|
|
1861
|
-
在 Web
|
|
2205
|
+
在 Web 上搜索最新信息。在必填的 `queries` 数组中提供 1–4 个查询。返回可选的摘要答案和来源 URL 列表。
|
|
1862
2206
|
|
|
1863
2207
|
```json
|
|
1864
2208
|
{
|
|
1865
2209
|
"type": "object",
|
|
1866
2210
|
"properties": {
|
|
1867
|
-
"
|
|
1868
|
-
"type": "
|
|
1869
|
-
"description": "
|
|
2211
|
+
"queries": {
|
|
2212
|
+
"type": "array",
|
|
2213
|
+
"description": "Required search queries; accepts 1–4 items and merges their results.",
|
|
2214
|
+
"items": {
|
|
2215
|
+
"type": "string"
|
|
2216
|
+
}
|
|
1870
2217
|
}
|
|
1871
2218
|
},
|
|
1872
2219
|
"required": [
|
|
1873
|
-
"
|
|
2220
|
+
"queries"
|
|
1874
2221
|
]
|
|
1875
2222
|
}
|
|
1876
2223
|
```
|
package/lib/index.js
ADDED
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* dsh-plugin-dev-kb — 主机插件(纯技能载体,无工具/命令)。
|
|
3
|
+
*
|
|
4
|
+
* 挂载于 profile 根层(全局层),唯一职责:把 skills/ 目录下的
|
|
5
|
+
* dsh-plugin-dev-kb 技能注册为 runtime skill,让每个会话的 agent
|
|
6
|
+
* 在插件开发 / 查询 dsh 能力 / 写 Tool / 配置 cordis.yml 类任务时,
|
|
7
|
+
* 能按技能 description 自动加载,从而获知知识库位置与阅读路径。
|
|
8
|
+
*
|
|
9
|
+
* 知识库数据(kb/ 目录:site/ 站点镜像 + extra/ 补充文档 + meta/
|
|
10
|
+
* 主题导航与索引)是纯文档,模型通过文件工具按技能指示直接读取。
|
|
11
|
+
*
|
|
12
|
+
* 依赖纪律:本模块不 import 任何 @deepseek-ai/* 运行时包(插件以
|
|
13
|
+
* link: 方式装入 profile,Node ESM 按 realpath 解析链接包,外部依赖
|
|
14
|
+
* 从插件目录解析不到;这里本来也不需要)。
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
import { existsSync, readdirSync, readFileSync, writeFileSync } from 'node:fs'
|
|
18
|
+
import { homedir } from 'node:os'
|
|
19
|
+
import { dirname, join } from 'node:path'
|
|
20
|
+
import { fileURLToPath } from 'node:url'
|
|
21
|
+
|
|
22
|
+
export const name = 'dsh-plugin-dev-kb'
|
|
23
|
+
export const inject = ['skills']
|
|
24
|
+
|
|
25
|
+
const PKG_DIR = dirname(fileURLToPath(import.meta.url))
|
|
26
|
+
const SKILLS_DIR = join(PKG_DIR, '..', 'skills')
|
|
27
|
+
|
|
28
|
+
/** 极简 frontmatter 解析(name/description/whenToUse)。 */
|
|
29
|
+
function parseFrontmatter(md) {
|
|
30
|
+
const match = /^---\r?\n([\s\S]*?)\r?\n---\r?\n?/.exec(md)
|
|
31
|
+
if (!match) return { name: undefined, description: undefined, whenToUse: undefined, body: md }
|
|
32
|
+
const meta = {}
|
|
33
|
+
for (const line of match[1].split(/\r?\n/)) {
|
|
34
|
+
const i = line.indexOf(':')
|
|
35
|
+
if (i <= 0) continue
|
|
36
|
+
const key = line.slice(0, i).trim()
|
|
37
|
+
if (key) meta[key] = line.slice(i + 1).trim().replace(/^["']|["']$/g, '')
|
|
38
|
+
}
|
|
39
|
+
return { ...meta, body: md.slice(match[0].length) }
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/** 从 skills/ 目录加载技能定义(文件缺失/无 frontmatter 时跳过并警告,绝不让插件挂载失败)。 */
|
|
43
|
+
function loadSkills() {
|
|
44
|
+
const out = []
|
|
45
|
+
if (!existsSync(SKILLS_DIR)) {
|
|
46
|
+
console.warn('[dsh-plugin-dev-kb] skills 目录缺失,技能未加载:' + SKILLS_DIR)
|
|
47
|
+
return out
|
|
48
|
+
}
|
|
49
|
+
for (const file of readdirSync(SKILLS_DIR)) {
|
|
50
|
+
if (!file.endsWith('.md')) continue
|
|
51
|
+
try {
|
|
52
|
+
const fm = parseFrontmatter(readFileSync(join(SKILLS_DIR, file), 'utf8'))
|
|
53
|
+
if (!fm.name || !fm.description) {
|
|
54
|
+
console.warn(`[dsh-plugin-dev-kb] 技能文件缺少 name/description frontmatter,已跳过:${file}`)
|
|
55
|
+
continue
|
|
56
|
+
}
|
|
57
|
+
out.push({
|
|
58
|
+
name: fm.name,
|
|
59
|
+
description: fm.description,
|
|
60
|
+
whenToUse: fm.whenToUse,
|
|
61
|
+
body: fm.body
|
|
62
|
+
})
|
|
63
|
+
} catch (err) {
|
|
64
|
+
console.warn(`[dsh-plugin-dev-kb] 技能文件读取失败,已跳过:${file}(${err?.message ?? err})`)
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
return out
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/** 挂载状态文件(自诊断:$DSH_HOME/dsh-plugin-dev-kb.state.json)。 */
|
|
71
|
+
function dshHome() {
|
|
72
|
+
return process.env.DSH_HOME || join(homedir(), '.dsh')
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export function apply(ctx, config) {
|
|
76
|
+
const disposers = []
|
|
77
|
+
const state = { skills: [] }
|
|
78
|
+
|
|
79
|
+
// 契约(dsh-skill validateDefinition):定义必须含 name/description/
|
|
80
|
+
// source/content 四个字符串;provider 缺省为 'runtime'。
|
|
81
|
+
for (const skill of loadSkills()) {
|
|
82
|
+
try {
|
|
83
|
+
disposers.push(ctx.skills.register({
|
|
84
|
+
name: skill.name,
|
|
85
|
+
description: skill.description,
|
|
86
|
+
...(skill.whenToUse ? { whenToUse: skill.whenToUse } : {}),
|
|
87
|
+
source: 'runtime',
|
|
88
|
+
content: skill.body
|
|
89
|
+
}))
|
|
90
|
+
state.skills.push(skill.name)
|
|
91
|
+
console.log(`[dsh-plugin-dev-kb] 技能已注册:${skill.name}`)
|
|
92
|
+
} catch (err) {
|
|
93
|
+
console.warn(`[dsh-plugin-dev-kb] 技能注册失败:${skill.name}(${err?.message ?? err})`)
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
try {
|
|
98
|
+
writeFileSync(join(dshHome(), 'dsh-plugin-dev-kb.state.json'), JSON.stringify({
|
|
99
|
+
plugin: 'dsh-plugin-dev-kb',
|
|
100
|
+
mountedAt: new Date().toISOString(),
|
|
101
|
+
skills: state.skills
|
|
102
|
+
}, null, 2), 'utf8')
|
|
103
|
+
} catch { /* 状态文件写入失败不影响挂载 */ }
|
|
104
|
+
|
|
105
|
+
console.log(`[dsh-plugin-dev-kb] 已挂载:${state.skills.length} 技能(知识库在 kb/ 目录)`)
|
|
106
|
+
|
|
107
|
+
// 卸载清理(HMR 重载时避免重复注册)。
|
|
108
|
+
return () => {
|
|
109
|
+
for (const dispose of disposers) {
|
|
110
|
+
try { dispose() } catch { /* ignore */ }
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}
|
package/package.json
CHANGED
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-plugin-dev-kb",
|
|
3
|
-
"description": "DeepSeek Harness (dsh) 插件开发知识库:官方文档站点的完整 Markdown 镜像(中英双语 168 页)+ 仓库补充文档(
|
|
4
|
-
"version": "1.0.
|
|
3
|
+
"description": "DeepSeek Harness (dsh) 插件开发知识库:官方文档站点的完整 Markdown 镜像(中英双语 168 页)+ 仓库补充文档(52 篇)+ 主题导航与搜索索引,以 dsh-plugin-dev-kb 技能形式让 agent 在插件开发任务中自动加载定位文档。纯数据插件,无运行时依赖。",
|
|
4
|
+
"version": "1.0.2",
|
|
5
5
|
"type": "module",
|
|
6
|
+
"main": "lib/index.js",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": "./lib/index.js",
|
|
9
|
+
"./package.json": "./package.json"
|
|
10
|
+
},
|
|
6
11
|
"files": [
|
|
12
|
+
"lib",
|
|
7
13
|
"kb",
|
|
8
14
|
"skills",
|
|
9
15
|
"scripts",
|
|
@@ -32,6 +38,12 @@
|
|
|
32
38
|
"url": "https://github.com/Pasumao/dsh-plugin-dev-kb/issues"
|
|
33
39
|
},
|
|
34
40
|
"license": "MIT",
|
|
41
|
+
"peerDependencies": {
|
|
42
|
+
"@deepseek-ai/cordis": "^4.0.1"
|
|
43
|
+
},
|
|
44
|
+
"engines": {
|
|
45
|
+
"node": ">=18"
|
|
46
|
+
},
|
|
35
47
|
"dsh": {
|
|
36
48
|
"bundle": {
|
|
37
49
|
"patch": "./cordis.patch.yml"
|
|
@@ -72,8 +72,9 @@ const table = (rows) => rows.length === 0
|
|
|
72
72
|
.join('\n')
|
|
73
73
|
|
|
74
74
|
const md = []
|
|
75
|
+
const extraCount = entries.filter(e => e.rel.startsWith('extra/')).length
|
|
75
76
|
md.push('# DeepSeek Harness 文档索引', '')
|
|
76
|
-
md.push(`> 由 \`scripts/rebuild-index.mjs\` 自动生成。共 ${siteRows.length} 个站点页面(中英双语),另有 ${
|
|
77
|
+
md.push(`> 由 \`scripts/rebuild-index.mjs\` 自动生成。共 ${siteRows.length} 个站点页面(中英双语),另有 ${extraCount} 个补充文档在 \`extra/\`。`, '')
|
|
77
78
|
md.push('## 中文站点(根路径)', '')
|
|
78
79
|
md.push('### 首页', '', table(group(rel => rel === 'site/index.md')), '')
|
|
79
80
|
md.push('### 入门(/guide/)', '', table(group(rel => !en(rel) && rel.startsWith('site/guide/'))), '')
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
// 最小自检:发布前验证结构完整(离线、零依赖)。node scripts/selfcheck.mjs
|
|
2
|
+
import { readFileSync, existsSync } from "node:fs";
|
|
3
|
+
import { join, dirname } from "node:path";
|
|
4
|
+
import { fileURLToPath } from "node:url";
|
|
5
|
+
|
|
6
|
+
const root = join(dirname(fileURLToPath(import.meta.url)), "..");
|
|
7
|
+
const failures = [];
|
|
8
|
+
|
|
9
|
+
const pkgPath = join(root, "package.json");
|
|
10
|
+
if (!existsSync(pkgPath)) failures.push("缺 package.json");
|
|
11
|
+
else {
|
|
12
|
+
let pkg;
|
|
13
|
+
try { pkg = JSON.parse(readFileSync(pkgPath, "utf8")); }
|
|
14
|
+
catch { failures.push("package.json 解析失败"); pkg = {}; }
|
|
15
|
+
if (pkg.name && pkg.main && !existsSync(join(root, pkg.main)))
|
|
16
|
+
failures.push(`入口不存在: ${pkg.main}`);
|
|
17
|
+
if (pkg.dsh?.bundle?.patch && !existsSync(join(root, pkg.dsh.bundle.patch)))
|
|
18
|
+
failures.push(`bundle patch 不存在: ${pkg.dsh.bundle.patch}`);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
for (const f of ["README.md", "LICENSE"]) {
|
|
22
|
+
if (!existsSync(join(root, f))) failures.push(`缺 ${f}`);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
if (failures.length) {
|
|
26
|
+
for (const f of failures) console.error(`[FAIL] ${f}`);
|
|
27
|
+
console.error(`${failures.length} 项失败`);
|
|
28
|
+
process.exit(1);
|
|
29
|
+
}
|
|
30
|
+
console.log("[PASS] 结构完整,可发布");
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: dsh-plugin-dev-kb
|
|
3
|
-
description: DeepSeek Harness 官方文档知识库的使用指南:知识库位置与结构、按任务场景的阅读路径、检索策略。写 dsh 插件 / Tool / 配置 / 服务 / 事件 / 打包发布 / LLM
|
|
3
|
+
description: DeepSeek Harness 官方文档知识库的使用指南:知识库位置与结构、按任务场景的阅读路径、检索策略。写 dsh 插件 / Tool / 配置 / 服务 / 事件 / 打包发布 / LLM 适配器时先加载本技能定位文档。注意:本技能仅限 dsh(DeepSeek Harness)插件开发;写 NoneBot 插件时请加载 nonebot-plugin-dev-kb,勿用本技能。
|
|
4
4
|
whenToUse: 开发 dsh 插件、查询 dsh 能力与 API、写 Tool、配置 cordis.yml、扩展 Harness 时
|
|
5
5
|
---
|
|
6
6
|
# dsh 插件开发知识库使用指南(dsh-plugin-dev-kb)
|
|
@@ -27,7 +27,7 @@ kb/
|
|
|
27
27
|
│ module-graph、testing、postmortem/(4)、i18n/、cookbook 与 subsystems 扩展
|
|
28
28
|
├── meta/
|
|
29
29
|
│ ├── topics.md ★ 主题导航:任务场景 → 要读的文件(先用这个)
|
|
30
|
-
│ ├── search-index.json 全量检索索引(
|
|
30
|
+
│ ├── search-index.json 全量检索索引(223 文件:path/url/title/字符数)
|
|
31
31
|
│ ├── source.json 来源信息(commit/时间/统计)
|
|
32
32
|
│ └── site-pages.txt 线上站点页面清单
|
|
33
33
|
├── INDEX.md 全部 站点 URL ↔ 本地文件 对照
|