@wwwfz/dsh-agent-bridge 0.9.0 → 0.11.0
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 +61 -99
- package/THIRD_PARTY_NOTICES.md +5 -63
- package/package.json +2 -1
- package/src/assets.js +32 -19
- package/src/catalog.js +1139 -906
- package/src/client.js +1218 -623
- package/src/conversation-readers.js +198 -0
- package/src/conversation-search.js +55 -0
- package/src/conversation-store.js +747 -0
- package/src/export.js +35 -2
- package/src/handoff.js +149 -0
- package/src/history-attachment.js +41 -0
- package/src/index.js +153 -7
- package/src/native-transcript.js +217 -0
- package/src/project-archive.js +50 -0
- package/src/projects.js +877 -149
- package/src/session-import.js +65 -19
- package/src/session-trace.js +1 -1
- package/src/skill-cli.js +287 -0
- package/src/skill-history.js +129 -0
- package/src/skill-output.js +19 -0
- package/src/skill-package.js +303 -321
- package/src/skill-provider.js +155 -193
- package/src/watch.js +11 -1
- package/web/inline-process.css +22 -0
- package/web/panel.css +547 -607
- package/web/panel.html +298 -277
- package/web/panel.js +3339 -2334
- package/web/reader.css +311 -0
- package/web/relay-categories.js +3 -0
- package/web/share-redaction.js +136 -0
- package/web/share-review.js +204 -0
package/README.md
CHANGED
|
@@ -2,153 +2,115 @@
|
|
|
2
2
|
|
|
3
3
|
# Agent Bridge
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
### 换个 Agent,接着做。
|
|
6
6
|
|
|
7
|
-
把本机其他 Agent
|
|
7
|
+
把本机其他 Agent 的对话、项目记忆和 Skills 带进 DeepSeek Harness,在熟悉的工作目录继续。
|
|
8
8
|
|
|
9
|
-
[下载 Desktop
|
|
9
|
+
[下载 v0.11.0 Desktop 插件](https://github.com/wfz2006/dsh-agent-bridge/releases/download/v0.11.0/dsh-agent-bridge.tgz) · [独立 Skill](#dsh-原生-skill) · [使用指南](#使用) · [图文介绍](https://wfz2006.github.io/dsh-agent-bridge/)
|
|
10
10
|
|
|
11
|
-
<
|
|
12
|
-
<img src="https://raw.githubusercontent.com/wfz2006/dsh-agent-bridge/main/docs/screenshots/v0.9.0/workspace.png" width="900" alt="Agent Bridge 的项目首屏。左侧可筛选项目,右侧可选最近对话或用项目资料开新对话。">
|
|
13
|
-
</a>
|
|
14
|
-
|
|
15
|
-
<sub>示例项目「接口调试台」 · v0.9.0 实际界面 · 点击查看大图</sub>
|
|
11
|
+
<img src="docs/screenshots/v0.10.0/workspace.png" width="900" alt="Agent Bridge v0.10.0 项目工作台">
|
|
16
12
|
|
|
17
13
|
</div>
|
|
18
14
|
|
|
19
|
-
##
|
|
20
|
-
|
|
21
|
-
### DSH Desktop
|
|
22
|
-
|
|
23
|
-
1. 下载 [GitHub 安装包 v0.9.0](https://github.com/wfz2006/dsh-agent-bridge/releases/latest/download/dsh-agent-bridge.tgz)。
|
|
24
|
-
2. 在 DSH 的 **插件 → 安装插件** 选择下载的 `.tgz`。
|
|
25
|
-
3. 完全退出再打开 DSH,从侧栏进入 **Agent 工作接续**。
|
|
26
|
-
|
|
27
|
-
### DSH Web
|
|
15
|
+
## 主要功能
|
|
28
16
|
|
|
29
|
-
|
|
17
|
+
- **搜索正文与定位回合**。在项目内跨会话查找原文、文件名和报错,点击命中结果即可跳到来源回合。
|
|
18
|
+
- **预览并接续会话**。勾选早期决定或工具结果,迁入前查看带给 Agent 的续聊上下文。已迁入的对话显示上次迁入时间,可打开现有 DSH 会话或另开副本。
|
|
19
|
+
- **整理项目接力单**。把多条会话中的内容整理到「已决定」「已完成」「未解决」「下一步」,可编辑、回跳来源和导出 Markdown。
|
|
20
|
+
- **审阅分享版 Markdown**。导出前检查本机路径、邮箱、IP 地址和常见凭据,逐项决定保留或脱敏,确认最终预览后下载。
|
|
21
|
+
- **带入项目资料与 Skills**。核对记忆和交接草稿。技能包读取、校验、快照保存和项目级登记由 Agent Bridge 实现,原生调用通过 DSH 的 Skill 服务完成。
|
|
30
22
|
|
|
31
|
-
|
|
32
|
-
dsh plugin --profile web add @wwwfz/dsh-agent-bridge
|
|
33
|
-
dsh web
|
|
34
|
-
~~~
|
|
23
|
+
<img src="docs/screenshots/v0.10.0/source-history.png" width="850" alt="v0.10.0 来源记录界面,显示图片、附件和可展开的工具过程">
|
|
35
24
|
|
|
36
|
-
|
|
37
|
-
> 下方演示的原对话统计、项目级原生 Skills 和新版 Markdown 预览来自 v0.9.0。
|
|
25
|
+
## 安装
|
|
38
26
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
## 使用
|
|
27
|
+
### 安装 v0.11.0
|
|
42
28
|
|
|
43
|
-
|
|
29
|
+
在 **DSH Desktop** 的 **插件 → 安装插件** 中选择 `dsh-agent-bridge.tgz`。完全退出并重新打开 DSH,在侧栏选择 **Agent 工作接续**。 [下载 v0.11.0 插件](https://github.com/wfz2006/dsh-agent-bridge/releases/download/v0.11.0/dsh-agent-bridge.tgz)
|
|
44
30
|
|
|
45
|
-
|
|
31
|
+
**DSH Web**。在已安装 DSH CLI 的环境运行以下命令。
|
|
46
32
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
#### 在哪里看原对话统计
|
|
33
|
+
```sh
|
|
34
|
+
dsh plugin --profile web add @wwwfz/dsh-agent-bridge@0.11.0
|
|
35
|
+
dsh web
|
|
36
|
+
```
|
|
52
37
|
|
|
53
|
-
|
|
38
|
+
### 从源码构建
|
|
54
39
|
|
|
55
|
-
|
|
56
|
-
<img src="https://raw.githubusercontent.com/wfz2006/dsh-agent-bridge/main/docs/screenshots/v0.9.0/source-record.png" width="700" alt="原对话统计显示轮次、消息、工具调用、时间跨度与 Token。第二轮展开后可见失败和未记录结果的工具条目。">
|
|
57
|
-
</a>
|
|
40
|
+
用 Node.js 22.13 或更高版本构建主分支。
|
|
58
41
|
|
|
59
|
-
|
|
42
|
+
```sh
|
|
43
|
+
git clone --branch main https://github.com/wfz2006/dsh-agent-bridge.git
|
|
44
|
+
cd dsh-agent-bridge
|
|
45
|
+
npm pack
|
|
46
|
+
```
|
|
60
47
|
|
|
61
|
-
|
|
62
|
-
<summary>可迁入的历史范围</summary>
|
|
48
|
+
在 DSH Desktop 的 **插件 → 安装插件** 中选择 `npm pack` 生成的 `.tgz`,完全退出并重新打开 DSH。
|
|
63
49
|
|
|
64
|
-
|
|
65
|
-
- 来源记录可保存 Codex 的可见思考摘要和工具调用,以及 Claude Code 的工具调用与结果。结果按调用 ID 归到原回合。历史工具数据以只读记录保存,后续请求按 DSH 当前权限执行。
|
|
66
|
-
- 宿主没有会话头部入口时,可在 Agent Bridge 的 **导出 DSH 会话** 中查看已保存的来源记录。旧版迁入的会话按当时保存的内容显示。
|
|
50
|
+
### DSH 原生 Skill
|
|
67
51
|
|
|
68
|
-
|
|
52
|
+
Agent Bridge Skill 可在 DSH 会话内按项目和来源查找旧对话,选取项目记忆并生成接续草稿或 Markdown。它通过 DSH Shell 调用随包附带的本地脚本,要求 Node.js 22.13 或更高版本。
|
|
69
53
|
|
|
70
|
-
|
|
54
|
+
| 在 DSH 里说 | Skill 可以完成 |
|
|
55
|
+
| --- | --- |
|
|
56
|
+
| 「接着我刚才在 Codex 里对这个项目的工作」 | 自动找最新可读会话,生成接续草稿 |
|
|
57
|
+
| 「找我上次做同步重试的项目和 Claude Code 对话」 | 跨项目查找,按标题筛选并分页 |
|
|
58
|
+
| 「看看第二轮的工具结果,把附件保存到项目」 | 分页查看来源历史,按需保存可读取的附件 |
|
|
59
|
+
| 「检查项目记忆和那个 Skill 的脚本,把选中的资料导出」 | 查看资料、核对 Skill 文件,导出本机版或分享版 Markdown |
|
|
60
|
+
| 「把这个项目置顶」 | 置顶、取消置顶、归档和恢复,和插件使用同一份项目状态 |
|
|
71
61
|
|
|
72
|
-
|
|
62
|
+
独立 Skill 的 `handoff --format share` 和 `history --format share` 默认脱敏正文和随文导出的工具结果。需要逐项决定保留哪些内容时,可在插件侧栏打开「审阅分享版」。Skill 和插件可同时使用。 [Skill 完整用法](skills/agent-bridge/references/commands.md)
|
|
73
63
|
|
|
74
|
-
|
|
64
|
+
将独立 Skill 0.3.1 的 ZIP 解压到项目的 `.dsh/skills/agent-bridge/`,或 DSH 用户目录的 `skills/agent-bridge/`,确保 `SKILL.md` 和 `scripts/` 位于同一级。打开该项目的 DSH 会话,选择 **agent-bridge**,例如「看看这个项目在 Codex 里上次做到哪里,生成接续草稿」。 [下载独立 Skill](https://github.com/wfz2006/dsh-agent-bridge/releases/download/v0.11.0/agent-bridge-skill-0.3.1.zip)
|
|
75
65
|
|
|
76
|
-
|
|
66
|
+
维护者可以在仓库用 `npm run build:skill -- .local/skill-release` 生成 `.local/skill-release/agent-bridge/`。打包市场 ZIP 时,把生成目录的 `SKILL.md`、`scripts/`、`references/` 和第三方声明放在 ZIP 根目录。
|
|
77
67
|
|
|
78
|
-
|
|
79
|
-
<img src="https://raw.githubusercontent.com/wfz2006/dsh-agent-bridge/main/docs/screenshots/v0.9.0/skill-review.png" width="509" alt="verify-endpoint 启用前的核对界面,列出目标项目、来源与四个包内文件。">
|
|
80
|
-
</a>
|
|
68
|
+
## 使用
|
|
81
69
|
|
|
82
|
-
|
|
70
|
+
### 迁入旧对话
|
|
83
71
|
|
|
84
|
-
|
|
85
|
-
|
|
72
|
+
1. 在项目列表中按名称、路径或 Agent 查找项目。
|
|
73
|
+
2. 打开最近对话,或在对话搜索中选「正文」。点击搜索结果可直接跳到来源回合。
|
|
74
|
+
3. 在完整历史中勾选「带入续聊」,可跨对话收集早期约束和关键结果。打开「Agent 将收到的续聊上下文」,核对近期问答和勾选内容。
|
|
75
|
+
4. 选择 **迁入并继续**。原目录离线时可选择新的本机目录。迁入后在 DSH 会话头部打开 **来源记录**,按回合查看正文、过程和附件。
|
|
86
76
|
|
|
87
|
-
|
|
88
|
-
- **可为此项目启用**表示可以为项目保存私有快照。快照位于 DSH 主目录的 `agent-bridge-skills/`,登记写入 `state.sqlite`。项目范围取最近的 `.git` 祖先,找不到时用原工作目录。
|
|
89
|
-
- **同名,待核对**时保留原技能,内容指纹一致才复用。预览后来源或项目位置改变,需要重新核对。
|
|
90
|
-
- **仅可带入说明**时使用 `SKILL.md` 正文摘录。指向包外的链接、包内特殊文件或疑似凭证文件会阻止整包启用。
|
|
91
|
-
- 启用确认的是快照和项目登记。执行脚本、使用专有工具、加载外部依赖仍取决于当前 DSH 环境。来源消失后,已有快照仍可管理。
|
|
77
|
+
已迁入的对话会显示上次迁入时间,默认打开最近一份仍可用的 DSH 会话。同一 Codex 配置和项目内,带原生会话 ID 的日志从活动目录移入归档后,仍可打开原 DSH 会话,接力单也可跳回原回合。选择「另开副本」可先预览,再创建独立会话。早期版本保存的时间以「约」标出。
|
|
92
78
|
|
|
93
|
-
|
|
79
|
+
若迁入失败,插件确认 DSH 尚未开始写入时,会提供「重新选择迁入目录」。选好目录后可再次核对原先的摘录,再确认迁入。若 DSH 已开始写入,重试会继续使用原来的会话。
|
|
94
80
|
|
|
95
|
-
|
|
81
|
+
### 用项目资料开新对话
|
|
96
82
|
|
|
97
|
-
|
|
98
|
-
- **导出 DSH 会话**。在面板右上角选择会话。需要工具名和结果摘录时,再勾选 **附带来源记录**。
|
|
99
|
-
- **接收一份交接**。把下载的 Markdown 放进接收项目的 `.agent-bridge/handoffs/`,刷新后从「上次做到哪」选用。
|
|
83
|
+
展开 **用项目资料开新对话**,选择项目记忆、交接或 Skills,点击 **预览草稿**。确认后打开新会话,草稿可在发送前编辑。启用原生 Skill 时,会先显示来源、项目范围和包内文件。
|
|
100
84
|
|
|
101
|
-
|
|
102
|
-
<img src="https://raw.githubusercontent.com/wfz2006/dsh-agent-bridge/main/docs/screenshots/v0.9.0/markdown-preview.png" width="509" alt="Markdown 预览保留标题、编号列表和检查项表格,可点开文档内的接口检查清单。">
|
|
103
|
-
</a>
|
|
85
|
+
### 整理项目接力单
|
|
104
86
|
|
|
105
|
-
|
|
87
|
+
打开「项目接力单」,点「从对话选内容」。在各条会话的完整历史中选择类别,将消息或工具结果加入「已决定」「已完成」「未解决」或「下一步」。接力单按项目保存在本机,可修改正文和分类,也可从条目跳回原回合。点「审阅并导出接力单」可下载 Markdown 给其他 Agent。
|
|
106
88
|
|
|
107
|
-
|
|
108
|
-
<summary>本机版、分享版和路径规则</summary>
|
|
89
|
+
### 导出与接收交接
|
|
109
90
|
|
|
110
|
-
|
|
111
|
-
- 预览从原文档目录解析相对链接,Host 核对项目范围和文件身份后让 DSH 打开。脚本等可执行文件提供定位。失效路径以文字保留。Markdown 的标题、代码块、表格和引用会排版,原始 HTML 按文字展示。
|
|
112
|
-
- 原工作目录离线时,可导出仍能读取的归档资料。
|
|
91
|
+
草稿、DSH 会话和来源全文均可导出 Markdown。本机版保留可核验的本机文件链接。选择「审阅分享版」后,正文和可选工具结果里命中的本机路径、邮箱、IP 地址和常见凭据默认脱敏。可逐处保留原文,核对最终 Markdown 后点「确认并下载」。
|
|
113
92
|
|
|
114
|
-
|
|
93
|
+
接收项目可将交接 Markdown 放入 `.agent-bridge/handoffs/`,刷新后选择使用。
|
|
115
94
|
|
|
116
95
|
## 支持来源
|
|
117
96
|
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
| 来源 | 常见可读取内容 |
|
|
121
|
-
| --- | --- |
|
|
122
|
-
| Codex、Claude Code、OpenCode、Qoder、WorkBuddy、Gemini CLI、Qwen Code | 本地工作目录和可识别的会话,含有记录的 Skill 使用 |
|
|
123
|
-
| VS Code 系列的 Copilot | 可识别的工作区和工作区会话 |
|
|
124
|
-
| Antigravity、TRAE | 本机工作区与可关联记录,另外可读配置的 AgentsView 归档 |
|
|
125
|
-
| 项目资料、WorkspaceHub、手动来源 | 可读 Markdown、共享记忆、交接和 Skill 目录 |
|
|
97
|
+
可读取的本机来源包括 Codex、Claude Code、OpenCode、Qoder、WorkBuddy、Gemini CLI、Qwen Code 和 VS Code Copilot。Antigravity 与 TRAE 的部分工作区记录及配置的 AgentsView 档案也可发现。
|
|
126
98
|
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
<details>
|
|
130
|
-
<summary>搜索、归档和主题</summary>
|
|
131
|
-
|
|
132
|
-
- 按 <kbd>/</kbd> 定位项目搜索,按 <kbd>↓</kbd> 选中首项,按 <kbd>Enter</kbd> 打开。项目的勾选和近期对话选项会分别保存。
|
|
133
|
-
- **置顶**常用项目。在 **最近接续** 可找回刚打开的项目。用 **整理 → 归档所选** 批量整理,在 **已归档** 恢复或撤销操作。
|
|
134
|
-
- 支持蓝、白、黑三套主题,自动记住选择。正在预览时,列表会等预览关闭后再更新。 [Agent 图标来源](web/agent-icons/NOTICE.md)
|
|
135
|
-
|
|
136
|
-
</details>
|
|
99
|
+
不同来源保存的信息不同。预览会标出可读取的内容和缺失项,加密或服务端记忆可先导出为 Markdown。插件在 Windows DSH Desktop 的隔离环境中验证,其他平台的路径规则有自动测试覆盖。
|
|
137
100
|
|
|
138
101
|
## 在项目里存放共享记忆
|
|
139
102
|
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
~~~text
|
|
103
|
+
```text
|
|
143
104
|
my-project/
|
|
144
105
|
.agent-bridge/
|
|
145
106
|
memory/
|
|
146
107
|
current-state.md
|
|
147
108
|
handoffs/
|
|
148
109
|
latest-handoff.md
|
|
149
|
-
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
刷新项目后即可选择第一层 Markdown 文件。
|
|
150
113
|
|
|
151
|
-
用 `current-state.md` 记当前目标、分支状态与待办,用 `latest-handoff.md` 记已完成事项、验证结果和下一步。两个目录的第一层 Markdown 会进入项目资料。
|
|
152
114
|
|
|
153
115
|
## 自定义来源
|
|
154
116
|
|
|
@@ -182,7 +144,7 @@ my-project/
|
|
|
182
144
|
|
|
183
145
|
## 卸载与构建
|
|
184
146
|
|
|
185
|
-
在 Desktop 插件管理页卸载 **dsh-agent-bridge**。Web 版运行 `dsh plugin --profile web remove dsh-agent-bridge
|
|
147
|
+
在 Desktop 插件管理页卸载 **dsh-agent-bridge**。Web 版运行 `dsh plugin --profile web remove dsh-agent-bridge`。在仓库目录运行 `npm test` 可执行测试。随包分发的 Markdown 库、Geist 字体和 Agent 图标见 [第三方声明](THIRD_PARTY_NOTICES.md)。
|
|
186
148
|
|
|
187
149
|
<details>
|
|
188
150
|
<summary>草稿失败时如何继续</summary>
|
package/THIRD_PARTY_NOTICES.md
CHANGED
|
@@ -1,67 +1,9 @@
|
|
|
1
1
|
# Third-party notices
|
|
2
2
|
|
|
3
|
-
Agent Bridge
|
|
4
|
-
projects. The adapted code is limited to skill package enumeration, stable
|
|
5
|
-
content fingerprints, safe copying, and isolated provider wiring.
|
|
3
|
+
Agent Bridge uses the following third-party components and assets.
|
|
6
4
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
- **markdown-it 15.0.3** for Markdown parsing and preview. The upstream license and the licenses of its bundled dependencies are in [web/vendor/markdown-it-LICENSE.txt](web/vendor/markdown-it-LICENSE.txt).
|
|
6
|
+
- **Geist** for the workbench and site typography. Its SIL Open Font License is in [web/Geist-OFL.txt](web/Geist-OFL.txt).
|
|
7
|
+
- **Agent source marks** for identifying supported products. See [web/agent-icons/NOTICE.md](web/agent-icons/NOTICE.md) for provenance and the accompanying licenses.
|
|
10
8
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
- Source: <https://github.com/xiaohai-78/dsh-mode-skills>
|
|
14
|
-
- Revision: `706595127984c9bc87627f77d2a8e288b8dcbbbb`
|
|
15
|
-
- Used for: package file limits, frontmatter parsing, link containment,
|
|
16
|
-
fingerprints, and copy verification in `src/skill-package.js`.
|
|
17
|
-
|
|
18
|
-
MIT License
|
|
19
|
-
|
|
20
|
-
Copyright (c) 2026 xiaohai-78
|
|
21
|
-
|
|
22
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
23
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
24
|
-
in the Software without restriction, including without limitation the rights
|
|
25
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
26
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
27
|
-
furnished to do so, subject to the following conditions:
|
|
28
|
-
|
|
29
|
-
The above copyright notice and this permission notice shall be included in all
|
|
30
|
-
copies or substantial portions of the Software.
|
|
31
|
-
|
|
32
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
33
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
34
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
35
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
36
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
37
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
38
|
-
SOFTWARE.
|
|
39
|
-
|
|
40
|
-
## dsh-skill-import
|
|
41
|
-
|
|
42
|
-
- Source: <https://github.com/Trank-DTK/dsh-skill-import>
|
|
43
|
-
- Revision: `68b56106e232aa15e206483d184150b144c13180`
|
|
44
|
-
- Used for: the isolated `FileSystemSkillProvider` registration pattern that
|
|
45
|
-
lets a plugin supply skills from its own DSH-private directory.
|
|
46
|
-
|
|
47
|
-
MIT License
|
|
48
|
-
|
|
49
|
-
Copyright (c) 2026 dsh-skill-import contributors
|
|
50
|
-
|
|
51
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
52
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
53
|
-
in the Software without restriction, including without limitation the rights
|
|
54
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
55
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
56
|
-
furnished to do so, subject to the following conditions:
|
|
57
|
-
|
|
58
|
-
The above copyright notice and this permission notice shall be included in all
|
|
59
|
-
copies or substantial portions of the Software.
|
|
60
|
-
|
|
61
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
62
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
63
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
64
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
65
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
66
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
67
|
-
SOFTWARE.
|
|
9
|
+
Agent Bridge runs inside DeepSeek Harness and uses its plugin and Skill service interfaces. Earlier release archives carry the notices applicable to those versions.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wwwfz/dsh-agent-bridge",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.0",
|
|
4
4
|
"description": "Standalone DeepSeek Harness plugin for live local agent discovery, context import, and Markdown handoff export.",
|
|
5
5
|
"keywords": ["dsh", "dsh-plugin", "deepseek-harness", "agent", "handoff", "skills"],
|
|
6
6
|
"repository": { "type": "git", "url": "git+https://github.com/wfz2006/dsh-agent-bridge.git" },
|
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
"engines": { "node": ">=22.13" },
|
|
20
20
|
"scripts": {
|
|
21
21
|
"test": "node --disable-warning=ExperimentalWarning --test",
|
|
22
|
+
"build:skill": "node scripts/build-skill.mjs",
|
|
22
23
|
"pack:local": "npm pack --pack-destination ."
|
|
23
24
|
},
|
|
24
25
|
"dsh": {
|
package/src/assets.js
CHANGED
|
@@ -22,6 +22,7 @@ const agentHomes = {
|
|
|
22
22
|
trae: ['.trae-cn', '.trae'],
|
|
23
23
|
workbuddy: ['.workbuddy'],
|
|
24
24
|
};
|
|
25
|
+
const projectMemoryAgents = new Set(['claude', 'qoder', 'qwen']);
|
|
25
26
|
const projectAgentFolders = {
|
|
26
27
|
'.agent': 'antigravity',
|
|
27
28
|
'.claude': 'claude',
|
|
@@ -258,7 +259,18 @@ async function exportedNotes(items, cwd, memoryExports) {
|
|
|
258
259
|
}));
|
|
259
260
|
}
|
|
260
261
|
|
|
261
|
-
async function nativeNotes(items, root, cwd, agent) {
|
|
262
|
+
async function nativeNotes(items, root, cwd, agent, projectOnly) {
|
|
263
|
+
if (!projectOnly) await agentNotes(items, root, agent);
|
|
264
|
+
if (cwd && projectMemoryAgents.has(agent)) {
|
|
265
|
+
const slug = cwd.replace(/[^\p{L}\p{N}]/gu, '-');
|
|
266
|
+
const asciiSlug = cwd.replace(/[^a-zA-Z0-9]/g, '-');
|
|
267
|
+
for (const name of new Set([slug, asciiSlug, slug.toLowerCase()])) {
|
|
268
|
+
await notesIn(items, root, path.join('projects', name, 'memory'), agent, 'project', '原生工作区记忆');
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
async function agentNotes(items, root, agent) {
|
|
262
274
|
const globalFolders = {
|
|
263
275
|
antigravity: ['knowledge'], claude: ['agent-memory'],
|
|
264
276
|
codex: ['memories', 'memories_v2', 'memories/extensions/ad_hoc/notes', 'memories_v2/extensions/ad_hoc/notes'],
|
|
@@ -279,13 +291,6 @@ async function nativeNotes(items, root, cwd, agent) {
|
|
|
279
291
|
opencode: ['AGENTS.md', 'MEMORY.md'], qwen: ['QWEN.md'], workbuddy: ['USER.md', 'SOUL.md', 'MEMORY.md'],
|
|
280
292
|
};
|
|
281
293
|
await Promise.all((instructionFiles[agent] ?? []).map((name) => addNote(items, root, name, agent, 'agent', '用户指引')));
|
|
282
|
-
if (cwd && ['claude', 'qoder', 'qwen'].includes(agent)) {
|
|
283
|
-
const slug = cwd.replace(/[^\p{L}\p{N}]/gu, '-');
|
|
284
|
-
const asciiSlug = cwd.replace(/[^a-zA-Z0-9]/g, '-');
|
|
285
|
-
for (const name of new Set([slug, asciiSlug, slug.toLowerCase()])) {
|
|
286
|
-
await notesIn(items, root, path.join('projects', name, 'memory'), agent, 'project', '原生工作区记忆');
|
|
287
|
-
}
|
|
288
|
-
}
|
|
289
294
|
}
|
|
290
295
|
|
|
291
296
|
async function skillFolder(items, root, relative, agent, scope, linkedRoots, detail, includeSystem = true) {
|
|
@@ -335,7 +340,9 @@ function unique(items) {
|
|
|
335
340
|
return [...indexed.values()].sort((a, b) => a.agent.localeCompare(b.agent) || a.name.localeCompare(b.name));
|
|
336
341
|
}
|
|
337
342
|
|
|
338
|
-
export async function listProjectAssets(project, config = {}
|
|
343
|
+
export async function listProjectAssets(project, config = {}, {
|
|
344
|
+
projectMemoryOnly = false, includeSkills = !projectMemoryOnly, includeGlobalMemory = !projectMemoryOnly,
|
|
345
|
+
} = {}) {
|
|
339
346
|
const home = config.home ?? homedir();
|
|
340
347
|
const cwd = await directory(project.cwd);
|
|
341
348
|
const hubs = (await Promise.all((config.workspaceHubRoots ?? []).map(directory))).filter(Boolean);
|
|
@@ -344,9 +351,15 @@ export async function listProjectAssets(project, config = {}) {
|
|
|
344
351
|
path.join(home, '.skillshare/skills'), path.join(home, 'AppData/Roaming/skillshare/skills'),
|
|
345
352
|
...(config.skillRoots ?? []), ...hubs.map((root) => path.join(root, 'skills/source')),
|
|
346
353
|
];
|
|
347
|
-
const sharedRoots = [...new Set((await Promise.all(sharedCandidates.map(directory))).filter(Boolean))];
|
|
354
|
+
const sharedRoots = includeSkills ? [...new Set((await Promise.all(sharedCandidates.map(directory))).filter(Boolean))] : [];
|
|
348
355
|
const agents = new Set((project.agents ?? []).map(agentId));
|
|
349
356
|
const configured = Object.entries(config.agentRoots ?? {});
|
|
357
|
+
if (projectMemoryOnly) {
|
|
358
|
+
for (const [name, roots] of configured) {
|
|
359
|
+
const agent = agentId(name);
|
|
360
|
+
if (roots?.length && (projectMemoryAgents.has(agent) || includeGlobalMemory || includeSkills)) agents.add(agent);
|
|
361
|
+
}
|
|
362
|
+
}
|
|
350
363
|
const memories = [];
|
|
351
364
|
const skills = [];
|
|
352
365
|
|
|
@@ -358,7 +371,7 @@ export async function listProjectAssets(project, config = {}) {
|
|
|
358
371
|
...Object.entries(projectInstructions).filter(([, owner]) => owner === agent).map(([file]) => (
|
|
359
372
|
addNote(memories, cwd, path.join(folder, file), agent, 'project', '项目指引')
|
|
360
373
|
)),
|
|
361
|
-
skillFolder(skills, cwd, path.join(folder, 'skills'), agent, 'project', sharedRoots, '项目 Skill'),
|
|
374
|
+
includeSkills && skillFolder(skills, cwd, path.join(folder, 'skills'), agent, 'project', sharedRoots, '项目 Skill'),
|
|
362
375
|
]);
|
|
363
376
|
});
|
|
364
377
|
await Promise.all([
|
|
@@ -367,9 +380,9 @@ export async function listProjectAssets(project, config = {}) {
|
|
|
367
380
|
notesIn(memories, cwd, '.agent-bridge/handoffs', 'shared', 'project', '项目交接'),
|
|
368
381
|
...hubs.map((root) => hubNotes(memories, root, cwd, project.projectIds ?? [])),
|
|
369
382
|
exportedNotes(memories, cwd, config.memoryExports),
|
|
370
|
-
|
|
383
|
+
includeSkills && Promise.all(['.agents/skills', '.skillshare/skills', 'skills'].map((folder) => (
|
|
371
384
|
skillFolder(skills, cwd, folder, 'shared', 'project', sharedRoots, '项目 Skill')
|
|
372
|
-
)),
|
|
385
|
+
))),
|
|
373
386
|
]);
|
|
374
387
|
}
|
|
375
388
|
|
|
@@ -387,17 +400,17 @@ export async function listProjectAssets(project, config = {}) {
|
|
|
387
400
|
const memoryRoots = [...new Set([...roots, ...configRoots])];
|
|
388
401
|
const skillRoots = config.opencodeSkillRoots === undefined ? memoryRoots : [...new Set(configRoots)];
|
|
389
402
|
await Promise.all([
|
|
390
|
-
...memoryRoots.map((root) => nativeNotes(memories, root, cwd, agent)),
|
|
391
|
-
|
|
403
|
+
...memoryRoots.map((root) => nativeNotes(memories, root, cwd, agent, !includeGlobalMemory)),
|
|
404
|
+
includeSkills && Promise.all(skillRoots.flatMap((root) => ['skills', 'skill'].map((folder) => (
|
|
392
405
|
skillFolder(skills, root, folder, agent, 'agent', sharedRoots, '智能体 Skill')
|
|
393
|
-
))),
|
|
406
|
+
)))),
|
|
394
407
|
]);
|
|
395
408
|
return;
|
|
396
409
|
}
|
|
397
410
|
await Promise.all(roots.flatMap((root) => [
|
|
398
|
-
nativeNotes(memories, root, cwd, agent),
|
|
399
|
-
skillFolder(skills, root, 'skills', agent, 'agent', sharedRoots, '智能体 Skill'),
|
|
400
|
-
|
|
411
|
+
nativeNotes(memories, root, cwd, agent, !includeGlobalMemory),
|
|
412
|
+
includeSkills && skillFolder(skills, root, 'skills', agent, 'agent', sharedRoots, '智能体 Skill'),
|
|
413
|
+
includeSkills && ['claude', 'codex'].includes(agent) && cachedPluginSkills(skills, root, agent),
|
|
401
414
|
]));
|
|
402
415
|
}),
|
|
403
416
|
]);
|