@agent-stash/dsh-skill-scout 0.0.0-stage → 0.2.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/LICENSE +202 -0
- package/README.md +147 -2
- package/cordis.patch.yml +4 -0
- package/dist/client.js +3708 -0
- package/dist/client.js.map +1 -0
- package/dist/index.js +13280 -0
- package/icon.svg +27 -0
- package/locale/en.json +6 -0
- package/locale/zh.json +6 -0
- package/package.json +74 -3
package/LICENSE
ADDED
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright [yyyy] [name of copyright owner]
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
package/README.md
CHANGED
|
@@ -1,3 +1,148 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @agent-stash/dsh-skill-scout
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[](https://www.npmjs.com/package/@agent-stash/dsh-skill-scout) [](https://github.com/deepseek-ai/deepseek-harness)
|
|
4
|
+
|
|
5
|
+
DeepSeek Harness(DSH)插件:在本机读取已经结束的会话,找出在多个会话里重复成功的流程和经过验证的修复,先由模型写一段摘要:发现了什么、Skill 做什么、打算新建或改进哪个 Skill。你同意摘要后,它才生成 Skill 草稿;你看过证据、预览过草稿之后,它才把 Skill 写进 `.agents/skills`。
|
|
6
|
+
|
|
7
|
+
支持 DSH Desktop 0.2.1-rc.3 与 DSH 0.2.2-alpha.2 的 Web 界面。
|
|
8
|
+
|
|
9
|
+
## 安装
|
|
10
|
+
|
|
11
|
+
DSH 桌面版:在「插件」页点「添加插件」,填入 `@agent-stash/dsh-skill-scout` 后安装。
|
|
12
|
+
|
|
13
|
+
命令行:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
dsh plugin --profile web add @agent-stash/dsh-skill-scout
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
安装后插件立即开始在本机分析会话。要让模型在后台给候选写摘要,在「插件 → 经验提炼 → 配置」里打开「后台生成摘要」。写摘要的「发现模型」和写 Skill 的「生成模型」分开设置,不选时都跟随 Agent 的默认模型。
|
|
20
|
+
|
|
21
|
+
## 使用
|
|
22
|
+
|
|
23
|
+
会话标题栏右侧有一个 Skill 图标。出现新的摘要或草稿时,图标上显示数量;打开收件箱后数量清零。没有建议时只有图标,不弹通知。
|
|
24
|
+
|
|
25
|
+
收件箱分三组:
|
|
26
|
+
|
|
27
|
+
- 「待你决定」:摘要等你同意的、草稿正在生成的、草稿可以保存的建议,以及草稿生成失败、摘要仍在的建议。卡片上显示摘要里的用途说明。
|
|
28
|
+
- 「本地发现」:规则找到、还没有摘要的候选,包括正在写摘要和摘要失败的。
|
|
29
|
+
- 「历史」:已保存、已忽略和摘要判定不值得保存的建议,默认收起。
|
|
30
|
+
|
|
31
|
+
点开一张卡片进入详情,最多有四页:
|
|
32
|
+
|
|
33
|
+
- 「摘要」:还没有摘要时,列出规则在这组任务里匹配到的步骤。有摘要后列出方案:发现了什么、Skill 的用途、何时使用、要新建或追加到的 Skill 和步骤提纲、照着做的风险(没有时不显示)、验证方式。
|
|
34
|
+
- 「Skill」:生成模型写的草稿。名称、描述、触发条件和正文都可以直接改。生成期间这一页显示按 SKILL.md 排版的占位条,系统设置了减少动态效果时占位条静止。
|
|
35
|
+
- 「改动」:目标路径和文件 diff。新 Skill 默认写进项目的 `.agents/skills/<name>/SKILL.md`,也可以选用户级的 `~/.agents/skills`。
|
|
36
|
+
- 「证据」:每个来源任务的请求、任务进行中你插入的消息、执行过的命令、退出码、失败时的一行错误,以及判定成功所依据的检查命令。摘要与草稿引用过的步骤有标记,「打开会话」跳回原会话。
|
|
37
|
+
|
|
38
|
+
详情底部的主操作随阶段变化:
|
|
39
|
+
|
|
40
|
+
- 「生成摘要」:把这组任务的证据发给发现模型,只换回几行摘要。上方写明证据会发给哪个模型。
|
|
41
|
+
- 「生成 Skill 草稿」或「生成追加内容」:同意摘要,把同样的证据和摘要里的方案发给生成模型。上方写明会发给哪个模型。草稿生成后,「Skill」页的「重新生成」按同一份摘要再写一次。
|
|
42
|
+
- 「保存 Skill」:写入文件,然后确认 DSH 的 Skill 列表里出现了它。保存后可以撤销;文件在保存之后被改过时,撤销会拒绝并说明原因。
|
|
43
|
+
- 「追加到 <Skill>」:摘要认为已有 Skill 覆盖了这个任务、但证据补充了缺失的步骤或注意事项时,只在原文件末尾追加一节,原有内容不变。
|
|
44
|
+
|
|
45
|
+
左侧的「忽略」把这一条移到历史,可以恢复;「忽略类似建议」让相近的流程以后也不再提示。
|
|
46
|
+
|
|
47
|
+
## 发现规则
|
|
48
|
+
|
|
49
|
+
- 什么算成功:只看工具结果。最后一次修改之后,每条命令的最后一次运行都成功;其中跑过测试、检查或构建的,记为「检查通过」。Agent 在回复里说「完成了」不算;用户下一条消息表示结果不对时,这次任务不再算成功。
|
|
50
|
+
- 命令按动作比较,写法不同的同一个动作算同一步:
|
|
51
|
+
- 包管理器:`pnpm build`、`npm run build`、`yarn build`、`bun run build` 是同一步;`npm i`、`npm ci`、`pnpm install`、`yarn` 是同一步;`npm install zod` 与 `pnpm add zod` 是同一步。任务运行器的任务按脚本算:`turbo run build`、`turbo build`、`lerna run build` 与 `pnpm build` 是同一步。
|
|
52
|
+
- 包里的命令行工具:`vitest`、`npx vitest`、`pnpm vitest`、`pnpm exec vitest`、`bunx vitest` 是同一步;`pytest`、`python -m pytest`、`uv run pytest` 是同一步。
|
|
53
|
+
- 脚本:`./scripts/release.sh`、`bash scripts/release.sh`、`sh ./scripts/release.sh` 是同一步;`tsx scripts/seed.ts`、`npx tsx scripts/seed.ts`、`ts-node scripts/seed.ts` 是同一步,`tsx scripts/seed-dev.ts` 是另一步。`bash -lc "…"` 里的命令按里面的命令算。
|
|
54
|
+
- 其他:`git checkout -b` 与 `git switch -c`、`docker-compose` 与 `docker compose`、`pip3` 与 `pip`、`cargo b` 与 `cargo build` 各是同一步。
|
|
55
|
+
- 不同的动作不合并:`pnpm build` 与 `pnpm test`、`pnpm install` 与 `pnpm add`、`git push` 与 `git pull`、`npm publish` 与 `npm version`、`vitest` 与 `jest` 都是不同的步骤。
|
|
56
|
+
- 内联代码(`python -c`、`node -e`)、HTTP 请求(`curl`、`wget`、`http`、`xh`)、远程登录(`ssh`、`scp`)和 `open` 从动作上看不出做了什么。它们在流程比较里和日常步骤一样权重低,不算有区分度的步骤,也不计入复杂流程的命令数。
|
|
57
|
+
- 工具调用按名字归类,去掉 MCP 前缀后比较:`bash`、`run_terminal_cmd`、`mcp__*__execute_command` 算执行命令;`edit`、`MultiEdit`、`apply_patch`、`mcp__*__write_file` 算改文件;读取、搜索类工具只计数;其他工具按工具名算一步。改 `package.json`、`CHANGELOG.md`、`*.config.ts`、`.github/workflows/*.yml` 这类有固定角色的文件也算流程里的一步。
|
|
58
|
+
- 重复流程:至少 2 个独立会话(可调)里,流程相近并且都成功。两个任务至少要共有一个有区分度的步骤;提交、推送、安装依赖、删除或移动文件这类每个任务都有的步骤权重低,跑测试、检查、构建权重居中,改普通源码文件不算步骤。`build` 与 `build:web` 这类同一前缀的脚本算部分相同。共有的步骤在两个任务里的先后顺序要大体一致。请求描述相近时,流程有四成相近即可;请求描述不相近(例如一个用中文、一个用英文)时,要共有两个以上有区分度的步骤,流程六成以上相同。从别的会话 fork 出来的会话只计入新增的部分;同一会话里的反复重试不算重复。
|
|
59
|
+
- 失败恢复:命令失败,接着安装依赖、改配置,或者改了这条命令的选项或环境变量(`pnpm test` 改成 `pnpm test --runInBand`),然后同一个动作成功,并有后续检查。失败与成功的写法可以不同,例如 `npm test` 失败、装好依赖后 `pnpm test` 通过。只换了文件、参数或选项的值不算修复,换一段内联代码、换一个 URL 也不算;中间用内联代码或 HTTP 请求查看情况不算修复动作。只改业务代码的修复,要在多个会话里遇到同一个错误才提示。跨会话比较错误时,路径、URL、版本号、行列号和平台名(`darwin-arm64`、`linux-x64-gnu`)先换成占位符;同一个错误出现在同一类命令的不同写法上(`pnpm build` 与 `npx vite build`)时,错误文本要几乎相同才算同一个问题。
|
|
60
|
+
- 复杂流程:一次经过验证、用到至少 5 个不同的非日常命令、跨 3 类以上命令的长任务,只作为摘要候选,摘要默认判为一次性工作。
|
|
61
|
+
- 已有 Skill:写摘要时附上最相关的已有 Skill,模型可以判为重复,或者建议追加内容。已保存的建议和「忽略类似」覆盖的流程不再提示;摘要判定不值得保存后,证据增加到两倍才重新摘要。
|
|
62
|
+
|
|
63
|
+
## 摘要与草稿
|
|
64
|
+
|
|
65
|
+
模型分两步参与,两步用的模型分开设置:
|
|
66
|
+
|
|
67
|
+
1. 摘要(发现模型):判断这组任务值不值得保存。值得时只给出方案:标题、发现了什么、Skill 的用途、何时使用、Skill 名称、最多 8 条步骤提纲、最多 3 条风险和验证方式,不写 Skill 本身。判断前先核对你的纠正、命令失败的原因和工具结果验证过的步骤,你否掉的步骤和没成功过的步骤不进提纲。后台摘要默认关闭;打开后按每日次数和最小间隔排队,超时后放弃,失败后分别在 10 分钟、1 小时、6 小时后自动重试,之后只能手动重试。你在详情里点的「生成摘要」不计入每日次数。关闭后台摘要或关闭会话分析后,插件不再发出后台模型请求。
|
|
68
|
+
2. 草稿(生成模型):只在你点「生成 Skill 草稿」或「生成追加内容」之后请求,只写摘要指定的那个 Skill,按方案里的何时使用、提纲和验证方式写,方案里的风险写成前置条件或限制,不扩大范围。你在任务中的纠正和命令失败的原因写成前置条件、注意事项或限制。后台从不生成草稿,失败也不自动重试。重新生成摘要会让旧草稿失效。
|
|
69
|
+
|
|
70
|
+
两步收到的是同一份脱敏后的证据包:规则匹配到的步骤、用户请求、任务进行中你插入的消息(每个任务最后 3 条)、你的下一条消息、命令行、退出码、每次失败的一行错误,以及最相关的已有 Skill 的内容。草稿请求另外带上你同意的摘要;追加内容时附上要改进的 Skill 全文。证据会话能看到名为 `skill-creator` 的 Skill 时,草稿请求还带上它的 SKILL.md(脱敏后取前 20000 字符)作为写 Skill 的指南,按 DSH 加载技能的格式(`<skill_content>`,带技能目录)附在提示词里,模型只采用其中写 SKILL.md 的部分;摘要请求不带。完整的工具输出、文件内容和 Agent 的思考过程不会发送。请求不带任何工具,也不在任何会话里运行。
|
|
71
|
+
|
|
72
|
+
摘要要通过这些检查:
|
|
73
|
+
|
|
74
|
+
- 符合插件定义的 JSON 结构,提纲不超过 8 条,风险不超过 3 条。
|
|
75
|
+
- 引用的证据编号都存在;值得保存的摘要至少引用一处证据。
|
|
76
|
+
- 新 Skill 的名称没有被证据会话可用的 Skill 占用;要改进的 Skill 存在。
|
|
77
|
+
- 没有凭据形态的文本和提示注入的痕迹。
|
|
78
|
+
|
|
79
|
+
草稿要通过这些检查:
|
|
80
|
+
|
|
81
|
+
- 符合插件定义的 JSON 结构,引用的证据编号都存在。
|
|
82
|
+
- 带命令的步骤要引用证据,命令链的每一段都和它引用的某次运行里的一段是同一个动作,写法可以不同(`pnpm bundle` 与 `npm run bundle`),而且这个动作在证据里成功过;复现失败的步骤可以引用那次失败。含命令替换时,替换部分与记录原样一致。不带命令的步骤可以不引用证据。
|
|
83
|
+
- 没有凭据形态的文本、提示注入的痕迹,也没有下载后直接交给 shell 执行的命令。
|
|
84
|
+
- 强制推送、递归删除、`sudo` 这类命令作为提醒显示在「Skill」页。
|
|
85
|
+
|
|
86
|
+
## 设置
|
|
87
|
+
|
|
88
|
+
| 分组 | 设置 | 默认 |
|
|
89
|
+
| ---------- | ---------------------------------------------- | ------------------- |
|
|
90
|
+
| 发现 | 分析已结束的会话 | 开 |
|
|
91
|
+
| 发现 | 历史范围(天) | 30 |
|
|
92
|
+
| 发现 | 启动时扫描的会话数 | 200 |
|
|
93
|
+
| 发现 | 静默期(会话空闲多少分钟后分析) | 2 |
|
|
94
|
+
| 发现 | 重复次数(独立会话数) | 2 |
|
|
95
|
+
| 摘要 | 后台生成摘要 | 关 |
|
|
96
|
+
| 摘要 | 发现模型与推理强度 | 跟随 Agent 默认模型 |
|
|
97
|
+
| 摘要 | 超时(秒) | 60 |
|
|
98
|
+
| 摘要 | 摘要要求(替换内置判断标准,回复格式始终保留) | 空 |
|
|
99
|
+
| 生成 Skill | 生成模型与推理强度 | 跟随 Agent 默认模型 |
|
|
100
|
+
| 生成 Skill | 超时(秒) | 180 |
|
|
101
|
+
| 限额 | 每日后台摘要次数 | 6 |
|
|
102
|
+
| 限额 | 后台摘要间隔(分钟) | 10 |
|
|
103
|
+
| 限额 | 证据上限(字符) | 24000 |
|
|
104
|
+
| 隐私 | 包含错误行 | 开 |
|
|
105
|
+
| 隐私 | 追加脱敏规则(每行一个正则) | 空 |
|
|
106
|
+
| 收件箱 | 标题栏角标:显示数量或只显示图标 | 显示数量 |
|
|
107
|
+
| 收件箱 | 新 Skill 保存到:项目或用户 | 项目 |
|
|
108
|
+
|
|
109
|
+
## 数据与安全
|
|
110
|
+
|
|
111
|
+
- 分析在 DSH Host 进程里进行,只读取 DSH 已经保存的会话日志。
|
|
112
|
+
- 会话文本在存储、发送和显示之前先在本机脱敏:常见的 API Key、token、私钥、`Authorization` 与 `Cookie` 头、`password=` 一类赋值、`--password` 一类参数、`user:pass` 形式的账号密码、URL 里的账号密码和邮箱地址都替换为占位符,用户主目录换成 `~`。命令签名也从脱敏后的命令解析。设置里可以追加自己的规则。
|
|
113
|
+
- 插件只存 Episode 记录、建议(含摘要与草稿)和最近两天的模型用量,放在 DSH storage domain `skill_scout` 里,不另起数据库或后台进程。超出历史范围的会话记录会被删除,仍待处理的建议引用的除外。
|
|
114
|
+
- 多个 DSH 实例同时运行时,只有拿到 `$DSH_HOME/skill-scout/worker.lock` 的那个分析会话与后台摘要,其他实例只显示收件箱。
|
|
115
|
+
- 写入只发生在你点保存之后,目标只能是项目或用户的 `.agents/skills`、`.dsh/skills` 下的 `<name>/SKILL.md`。已有同名文件时拒绝写入;改进已有 Skill 时,预览之后文件被改过也会拒绝。
|
|
116
|
+
- 摘要与草稿请求不创建会话,不会被再次分析;子代理会话也不分析。
|
|
117
|
+
|
|
118
|
+
## 性能
|
|
119
|
+
|
|
120
|
+
- Agent 运行时插件不做分析:一个会话的回合结束后,等它空闲一段时间(默认 2 分钟)才读取这个会话。
|
|
121
|
+
- 读取与提取在 Host 进程里逐个会话进行,会话之间让出事件循环。开发机上用测试数据测得:200 个会话、3650 个事件的提取约 30 ms,跨会话检测约 5 ms;一个 2000 个事件的长会话提取约 20 ms。读取会话日志的耗时由 DSH 的 Session Query 决定,不在这些数字里。
|
|
122
|
+
- 存储里只有 Episode 记录,测试数据的 200 个会话约 240 KB。
|
|
123
|
+
- 每次摘要或草稿请求发送的证据不超过设置里的字符上限,默认 24000。
|
|
124
|
+
|
|
125
|
+
## 已知限制
|
|
126
|
+
|
|
127
|
+
- 收件箱和设置页只在 DSH Web 与桌面版里提供。
|
|
128
|
+
- 请求相似度按词重合计算。用不同语言描述的同一任务,要共有两个以上有区分度的步骤才会归为一组。
|
|
129
|
+
- 动作归并覆盖 npm、pnpm、yarn、bun、turbo、lerna、脚本解释器与 TypeScript 运行器、git、gh、docker、cargo、uv、pip 与 Python 模块入口;其他程序按程序名加子命令比较,同一工具的别名写法不会合并。
|
|
130
|
+
- 主要由内联代码或 HTTP 请求组成的流程(例如用 `curl` 调接口完成的部署)不算有区分度,不会单独构成重复流程。
|
|
131
|
+
- 失败恢复要求修复后重新运行同一个动作;换了另一个工具完成的修复(例如 `jest` 失败后改用 `vitest`)不会被识别。
|
|
132
|
+
- 改进已有 Skill 只追加一节,不改写原有段落。
|
|
133
|
+
- 退出码从 bash 与 PowerShell 的结果里读取,包括 `run_code` 里发起的命令;其他工具只看它是否报错。
|
|
134
|
+
- 脱敏按已知的写法匹配,格式不常见的凭据可能漏掉;可以在设置里追加正则。
|
|
135
|
+
|
|
136
|
+
## 开发
|
|
137
|
+
|
|
138
|
+
```bash
|
|
139
|
+
pnpm install
|
|
140
|
+
pnpm --filter @agent-stash/dsh-skill-scout run bundle # 构建 dist/index.js(Host)与 dist/client.js(浏览器)
|
|
141
|
+
pnpm exec vitest run packages/dsh-skill-scout
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
`dist/` 随仓库提交。设计取舍与数据流见 [architecture.md](architecture.md)。
|
|
145
|
+
|
|
146
|
+
## 许可证
|
|
147
|
+
|
|
148
|
+
Apache-2.0,见 [LICENSE](LICENSE)。
|
package/cordis.patch.yml
ADDED