@xiangyixie/dsh-superagent 0.14.0 → 0.14.1
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/CHANGELOG.md +21 -1
- package/README.en.md +1771 -0
- package/README.md +1167 -1756
- package/README.zh.md +1167 -0
- package/docs/DETAIL.md +37 -0
- package/docs/DETAIL.zh.md +37 -0
- package/icon.svg +10 -0
- package/lib/doctor.js +33 -1
- package/locale/en.json +7 -0
- package/locale/zh.json +7 -0
- package/package.json +13 -4
package/docs/DETAIL.md
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# Superagent
|
|
2
|
+
|
|
3
|
+
Long-horizon autonomous runs: give it one goal and it plans parallel subtasks, runs them in workers, and merges the outcome into one report. A restart does not throw the work away.
|
|
4
|
+
|
|
5
|
+
## What it solves
|
|
6
|
+
|
|
7
|
+
- **A goal that does not fit one step.** The goal is planned into dependent subtasks and advanced step by step instead of being crammed into one conversation.
|
|
8
|
+
- **Work that runs too slowly in sequence.** Independent subtasks run in parallel, each in its own worktree, without overwriting one another.
|
|
9
|
+
- **Runs that get interrupted.** The plan, progress, and produced files are durable; a host restart or a closed conversation does not reset the run.
|
|
10
|
+
- **Results that need checking.** Every subtask keeps its status, usage, and cost, and the merged report states failures and gaps instead of hiding them.
|
|
11
|
+
|
|
12
|
+
## Install
|
|
13
|
+
|
|
14
|
+
The desktop app's Add plugin dialog accepts any of these three inputs:
|
|
15
|
+
|
|
16
|
+
1. **Package name**: `@xiangyixie/dsh-superagent@0.14.1`
|
|
17
|
+
2. **GitHub repository**: `https://github.com/LittleChenLiya/dsh-superagent`
|
|
18
|
+
3. **Local directory**: `file:` followed by the absolute path of the checkout
|
|
19
|
+
|
|
20
|
+
You can also add the plugin index on the Discover page and install from there:
|
|
21
|
+
|
|
22
|
+
```
|
|
23
|
+
https://raw.githubusercontent.com/LittleChenLiya/dsh-superagent/main/plugin-index.json
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
Upgrading is **remove-then-add**. Any other plugin in the same profile must also be removed before its new version is added; do not expect the dialog to replace it in place.
|
|
27
|
+
|
|
28
|
+
## When commands are needed
|
|
29
|
+
|
|
30
|
+
Workers plan and read/write files by default. Enable `commandWorkerPermission` when they must run commands, builds, or tests. Without it the plugin still works, but command steps are refused.
|
|
31
|
+
|
|
32
|
+
## Safety and cost
|
|
33
|
+
|
|
34
|
+
- Irreversible actions, uploads, and network destinations are policed, and a run can be stopped.
|
|
35
|
+
- Cost is estimated from the configured price table. A model without a price is reported as `unpriced`, never as zero, and currencies are totalled separately rather than added together.
|
|
36
|
+
|
|
37
|
+
The full commands, configuration, and design notes are in the [README](https://github.com/LittleChenLiya/dsh-superagent#readme).
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# 超级智能体
|
|
2
|
+
|
|
3
|
+
长周期自主执行插件:给出一个目标,它把目标拆成可并行的子任务,交给 worker 执行,最后合并成一份报告。进程重启后仍能从断点继续,不必从头再来。
|
|
4
|
+
|
|
5
|
+
## 它解决什么问题
|
|
6
|
+
|
|
7
|
+
- **目标大,一步做不完。** 把一句话目标拆成有依赖关系的子任务,按计划推进,而不是把所有事塞进一次对话。
|
|
8
|
+
- **串行太慢。** 互不依赖的子任务并行执行,各自在自己的工作区里干活,互不覆盖。
|
|
9
|
+
- **中途会断。** 计划、进度和已产出的文件都落盘;宿主重启或对话结束之后可以继续。
|
|
10
|
+
- **结果要能核对。** 每个子任务都留下状态、用量和成本,最后合并成一份可读的报告,失败和遗漏不会被悄悄吞掉。
|
|
11
|
+
|
|
12
|
+
## 安装
|
|
13
|
+
|
|
14
|
+
桌面应用的「添加插件」对话框接受三种输入,任选一种:
|
|
15
|
+
|
|
16
|
+
1. **包名**:`@xiangyixie/dsh-superagent@0.14.1`
|
|
17
|
+
2. **GitHub 仓库**:`https://github.com/LittleChenLiya/dsh-superagent`
|
|
18
|
+
3. **本地目录**:`file:` 加上插件目录的绝对路径
|
|
19
|
+
|
|
20
|
+
也可以从「发现」页添加插件索引,然后一键安装:
|
|
21
|
+
|
|
22
|
+
```
|
|
23
|
+
https://raw.githubusercontent.com/LittleChenLiya/dsh-superagent/main/plugin-index.json
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
升级时是**先卸载再装新版**。同一个 profile 里的其他插件也要先卸载,再装它们的新版;不要让对话框直接覆盖。
|
|
27
|
+
|
|
28
|
+
## 需要命令执行能力时
|
|
29
|
+
|
|
30
|
+
worker 默认只做规划与读写;如果要让它运行命令、构建或测试,请开启 `commandWorkerPermission`。不开也能用,但涉及命令的步骤会被拦下。
|
|
31
|
+
|
|
32
|
+
## 安全与成本
|
|
33
|
+
|
|
34
|
+
- 不可逆操作、文件上传和域名访问都受策略约束,可随时停止。
|
|
35
|
+
- 成本按配置的价目表估算;没有价目的模型明确标成 `unpriced`,不会显示成 0。多币种分别合计,不跨币种相加。
|
|
36
|
+
|
|
37
|
+
完整的命令、配置和设计说明见 [README](https://github.com/LittleChenLiya/dsh-superagent#readme)。
|
package/icon.svg
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" role="img" aria-label="Superagent">
|
|
2
|
+
<rect x="16" y="16" width="480" height="480" rx="112" fill="#0f766e"/>
|
|
3
|
+
<rect x="16" y="16" width="480" height="480" rx="112" fill="none" stroke="#99f6e4" stroke-width="16"/>
|
|
4
|
+
<path d="M256 148v44M256 192H144v56M256 192h112v56M256 192v56" fill="none" stroke="#f0fdfa" stroke-width="24" stroke-linecap="round"/>
|
|
5
|
+
<circle cx="256" cy="116" r="40" fill="#f0fdfa"/>
|
|
6
|
+
<circle cx="144" cy="280" r="34" fill="#f0fdfa"/>
|
|
7
|
+
<circle cx="256" cy="280" r="34" fill="#f0fdfa"/>
|
|
8
|
+
<circle cx="368" cy="280" r="34" fill="#f0fdfa"/>
|
|
9
|
+
<rect x="144" y="352" width="224" height="44" rx="22" fill="#f0fdfa"/>
|
|
10
|
+
</svg>
|
package/lib/doctor.js
CHANGED
|
@@ -233,6 +233,33 @@ async function resolveLocalFile(packageRoot, fromRel, specifier) {
|
|
|
233
233
|
return joined
|
|
234
234
|
}
|
|
235
235
|
|
|
236
|
+
/**
|
|
237
|
+
* Expand a wildcard export target (`locale/*.json`) against disk. A pattern
|
|
238
|
+
* without `*` is returned unchanged; a `*` outside the final path segment is
|
|
239
|
+
* left literal, because only single-segment patterns are used today.
|
|
240
|
+
*/
|
|
241
|
+
async function expandWildcard(packageRoot, rel) {
|
|
242
|
+
const star = rel.indexOf('*')
|
|
243
|
+
if (star < 0) return [rel]
|
|
244
|
+
const slash = rel.lastIndexOf('/', star)
|
|
245
|
+
const dir = slash < 0 ? '.' : rel.slice(0, slash)
|
|
246
|
+
const pattern = slash < 0 ? rel : rel.slice(slash + 1)
|
|
247
|
+
if (pattern.includes('/')) return [rel]
|
|
248
|
+
const escaped = pattern.replace(/[.+^${}()|[\]\\]/g, '\\$&').split('*').join('[^/]*')
|
|
249
|
+
const matcher = new RegExp(`^${escaped}$`)
|
|
250
|
+
let names
|
|
251
|
+
try {
|
|
252
|
+
names = await fsp.readdir(path.join(packageRoot, dir))
|
|
253
|
+
} catch {
|
|
254
|
+
return [rel]
|
|
255
|
+
}
|
|
256
|
+
const matches = names
|
|
257
|
+
.filter(name => matcher.test(name))
|
|
258
|
+
.sort()
|
|
259
|
+
.map(name => (dir === '.' ? name : `${dir}/${name}`))
|
|
260
|
+
return matches.length > 0 ? matches : [rel]
|
|
261
|
+
}
|
|
262
|
+
|
|
236
263
|
/**
|
|
237
264
|
* Files the package cannot run without: entry points plus everything they
|
|
238
265
|
* import, transitively. `package.json` is included because `index.js` reads its
|
|
@@ -250,8 +277,13 @@ export async function requiredFiles(packageRoot) {
|
|
|
250
277
|
addRoot(pkg.dsh?.bundle?.patch)
|
|
251
278
|
if (roots.size === 0) addRoot('lib/index.js')
|
|
252
279
|
|
|
280
|
+
const entries = new Set()
|
|
281
|
+
for (const root of roots) {
|
|
282
|
+
for (const rel of await expandWildcard(packageRoot, root)) entries.add(rel)
|
|
283
|
+
}
|
|
284
|
+
|
|
253
285
|
const required = new Set()
|
|
254
|
-
const queue = [...
|
|
286
|
+
const queue = [...entries]
|
|
255
287
|
while (queue.length > 0) {
|
|
256
288
|
const rel = queue.shift()
|
|
257
289
|
if (required.has(rel)) continue
|
package/locale/en.json
ADDED
package/locale/zh.json
ADDED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xiangyixie/dsh-superagent",
|
|
3
|
-
"version": "0.14.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.14.1",
|
|
4
|
+
"description": "长周期自主执行插件:一个目标拆成可并行的子任务,交付一份合并报告,重启后仍可继续。",
|
|
5
5
|
"author": "Admire (LittleChenLiya)",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"repository": {
|
|
@@ -12,7 +12,8 @@
|
|
|
12
12
|
"bugs": {
|
|
13
13
|
"url": "https://github.com/LittleChenLiya/dsh-superagent/issues"
|
|
14
14
|
},
|
|
15
|
-
"main": "lib/index.js",
|
|
15
|
+
"main": "lib/index.js",
|
|
16
|
+
"icon": "./icon.svg",
|
|
16
17
|
"bin": {
|
|
17
18
|
"dsh-superagent-watch": "bin/watch.js",
|
|
18
19
|
"dsh-superagent-report": "bin/report.js",
|
|
@@ -23,6 +24,8 @@
|
|
|
23
24
|
},
|
|
24
25
|
"exports": {
|
|
25
26
|
".": "./lib/index.js",
|
|
27
|
+
"./icon": "./icon.svg",
|
|
28
|
+
"./locale/*.json": "./locale/*.json",
|
|
26
29
|
"./cordis.patch.yml": "./cordis.patch.yml",
|
|
27
30
|
"./package.json": "./package.json"
|
|
28
31
|
},
|
|
@@ -31,6 +34,8 @@
|
|
|
31
34
|
"access": "public"
|
|
32
35
|
},
|
|
33
36
|
"files": [
|
|
37
|
+
"icon.svg",
|
|
38
|
+
"locale/*.json",
|
|
34
39
|
"lib/index.js",
|
|
35
40
|
"lib/orchestrator.js",
|
|
36
41
|
"lib/store.js",
|
|
@@ -71,8 +76,12 @@
|
|
|
71
76
|
"public/console.html",
|
|
72
77
|
"cordis.patch.yml",
|
|
73
78
|
"docs/policy.example.json",
|
|
79
|
+
"docs/DETAIL.md",
|
|
80
|
+
"docs/DETAIL.zh.md",
|
|
74
81
|
"CHANGELOG.md",
|
|
75
|
-
"README.md"
|
|
82
|
+
"README.md",
|
|
83
|
+
"README.en.md",
|
|
84
|
+
"README.zh.md"
|
|
76
85
|
],
|
|
77
86
|
"dependencies": {},
|
|
78
87
|
"engines": {
|