@goodandready/dsh-goal 0.1.8 → 0.1.10
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 +121 -44
- package/{docs/README.ru.md → README.ru.md} +12 -1
- package/README.zh.md +219 -0
- package/docs/design/DESIGN.md +23 -0
- package/lib/client.js +146 -61
- package/lib/command-handler.js +76 -34
- package/lib/goal-engine.js +49 -5
- package/lib/index.js +344 -131
- package/package.json +6 -4
- package/docs/README.zh.md +0 -143
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@goodandready/dsh-goal",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"description": "Goal
|
|
3
|
+
"version": "0.1.10",
|
|
4
|
+
"description": "Autonomous Goal Execution & Multi-Turn Task Tracking Engine with Sticky Header for DeepSeek Harness",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./lib/index.js",
|
|
7
7
|
"exports": {
|
|
@@ -14,8 +14,10 @@
|
|
|
14
14
|
"lib/",
|
|
15
15
|
"cordis.patch.yml",
|
|
16
16
|
"README.md",
|
|
17
|
-
"
|
|
18
|
-
"
|
|
17
|
+
"README.ru.md",
|
|
18
|
+
"README.zh.md",
|
|
19
|
+
"LICENSE",
|
|
20
|
+
"docs/design/DESIGN.md"
|
|
19
21
|
],
|
|
20
22
|
"scripts": {
|
|
21
23
|
"test": "node --test test/*.test.mjs"
|
package/docs/README.zh.md
DELETED
|
@@ -1,143 +0,0 @@
|
|
|
1
|
-
# 📦 @goodandready/dsh-goal
|
|
2
|
-
|
|
3
|
-
<div align="center">
|
|
4
|
-
|
|
5
|
-
<h3>面向 DeepSeek Harness 的自主目标执行、任务里程碑分解与顶部常驻状态条引擎</h3>
|
|
6
|
-
|
|
7
|
-
<p align="center">
|
|
8
|
-
<a href="https://www.npmjs.com/package/@goodandready/dsh-goal"><img src="https://img.shields.io/npm/v/@goodandready/dsh-goal.svg?style=for-the-badge&color=6366f1&labelColor=1e1b4b" alt="npm version"></a>
|
|
9
|
-
<a href="../LICENSE"><img src="https://img.shields.io/github/license/GooDAnDReaDY/dsh-goal.svg?style=for-the-badge&color=10b981&labelColor=064e3b" alt="license"></a>
|
|
10
|
-
<a href="https://github.com/topics/dsh-plugin"><img src="https://img.shields.io/badge/DSH-Plugin-8b5cf6.svg?style=for-the-badge&labelColor=2e1065" alt="DSH Plugin"></a>
|
|
11
|
-
<a href="https://nodejs.org"><img src="https://img.shields.io/badge/Node-20%2B-f59e0b.svg?style=for-the-badge&labelColor=451a03" alt="Node version"></a>
|
|
12
|
-
</p>
|
|
13
|
-
|
|
14
|
-
<!-- 作者所有项目展示页面链接 -->
|
|
15
|
-
<p align="center">
|
|
16
|
-
<a href="https://goodandready.app/"><img src="https://img.shields.io/badge/作者所有开源项目-goodandready.app-ff4500.svg?style=for-the-badge&logo=rocket&logoColor=white&labelColor=1a1a2e" alt="所有项目"></a>
|
|
17
|
-
</p>
|
|
18
|
-
|
|
19
|
-
<p align="center">
|
|
20
|
-
<a href="../README.md"><b>🇬🇧 English</b></a> •
|
|
21
|
-
<a href="README.ru.md"><b>🇷🇺 Русский</b></a> •
|
|
22
|
-
<a href="README.zh.md"><b>🇨🇳 中文说明</b></a>
|
|
23
|
-
</p>
|
|
24
|
-
|
|
25
|
-
</div>
|
|
26
|
-
|
|
27
|
-
---
|
|
28
|
-
|
|
29
|
-
## ⚡ 概述与核心解决痛点
|
|
30
|
-
|
|
31
|
-
复杂的软件工程任务往往需要多步骤的自主循环:将宏观目标分解为里程碑子任务、多轮自动连续推进而无需用户反复手动下发指令,以及对执行过程保持清晰的可视化监控。
|
|
32
|
-
|
|
33
|
-
**`@goodandready/dsh-goal`** 通过 `/goal` 指令为 DeepSeek Harness 带来原生的目标自主执行系统:
|
|
34
|
-
* 🎯 **顶部常驻状态条**:固定在聊天窗口顶部的状态横幅,显示实时运行计时器(`• 2s`, `• 1m 45s`)、当前目标标题与控制按钮。
|
|
35
|
-
* ⏸️ **自主循环控制 (Play / Pause / Cancel)**:可随时暂停智能体自主多轮循环,或根据需要一键恢复。
|
|
36
|
-
* 📋 **里程碑任务抽屉**:交互式子任务清单,展示完成百分比进度条与执行日志。
|
|
37
|
-
* 🤖 **智能体原生工具**:提供 `goal_set_milestones`, `goal_update_progress`, `goal_finish` 工具。
|
|
38
|
-
* 🛡️ **安全防护机制**:支持配置 `maxIterations` 最大循环轮次,杜绝死循环消耗。
|
|
39
|
-
|
|
40
|
-
---
|
|
41
|
-
|
|
42
|
-
## 🏛️ 架构设计
|
|
43
|
-
|
|
44
|
-
```mermaid
|
|
45
|
-
graph TD
|
|
46
|
-
subgraph Input ["用户交互与输入"]
|
|
47
|
-
Cmd["聊天斜杠指令: /goal <目标描述>"]
|
|
48
|
-
API["REST API 路由: POST /dsh-goal/action"]
|
|
49
|
-
end
|
|
50
|
-
|
|
51
|
-
subgraph GoalEngine ["目标生命周期引擎 (lib/index.js)"]
|
|
52
|
-
State["状态机 (IDLE, RUNNING, PAUSED, COMPLETED)"]
|
|
53
|
-
Milestones["里程碑分解与进度追踪器"]
|
|
54
|
-
Disk["状态持久化存储 (~/.dsh/goal-state.json)"]
|
|
55
|
-
end
|
|
56
|
-
|
|
57
|
-
subgraph AgentLoop ["智能体自主执行驱动"]
|
|
58
|
-
ToolSet["goal_set_milestones"]
|
|
59
|
-
ToolProgress["goal_update_progress"]
|
|
60
|
-
ToolFinish["goal_finish"]
|
|
61
|
-
LimitGuard{"maxIterations 熔断防护"}
|
|
62
|
-
end
|
|
63
|
-
|
|
64
|
-
subgraph UI ["DSH Web 前端界面"]
|
|
65
|
-
Banner["顶部常驻状态横幅"]
|
|
66
|
-
Timer["实时执行计时器"]
|
|
67
|
-
Drawer["里程碑清单详情模态框"]
|
|
68
|
-
Settings["设置面板卡片 (Schemastery)"]
|
|
69
|
-
end
|
|
70
|
-
|
|
71
|
-
Cmd --> GoalEngine
|
|
72
|
-
API --> GoalEngine
|
|
73
|
-
GoalEngine --> State
|
|
74
|
-
State --> Disk
|
|
75
|
-
State --> Banner
|
|
76
|
-
State --> Drawer
|
|
77
|
-
GoalEngine --> AgentLoop
|
|
78
|
-
AgentLoop --> LimitGuard
|
|
79
|
-
ToolSet --> GoalEngine
|
|
80
|
-
ToolProgress --> GoalEngine
|
|
81
|
-
ToolFinish --> GoalEngine
|
|
82
|
-
```
|
|
83
|
-
|
|
84
|
-
---
|
|
85
|
-
|
|
86
|
-
## 📦 快速安装
|
|
87
|
-
|
|
88
|
-
```bash
|
|
89
|
-
dsh plugin --profile web add @goodandready/dsh-goal
|
|
90
|
-
```
|
|
91
|
-
|
|
92
|
-
重启 DeepSeek Harness 实例并刷新浏览器页面。
|
|
93
|
-
|
|
94
|
-
---
|
|
95
|
-
|
|
96
|
-
## 💬 快速上手
|
|
97
|
-
|
|
98
|
-
在聊天框中直接启动自主目标:
|
|
99
|
-
|
|
100
|
-
```text
|
|
101
|
-
/goal 重构身份验证中间件并编写端到端集成测试
|
|
102
|
-
```
|
|
103
|
-
|
|
104
|
-
或通过 REST 接口调用:
|
|
105
|
-
|
|
106
|
-
```bash
|
|
107
|
-
curl -X POST http://localhost:3080/dsh-goal/action \
|
|
108
|
-
-H "Content-Type: application/json" \
|
|
109
|
-
-d '{"action":"start","title":"优化数据库查询性能"}'
|
|
110
|
-
```
|
|
111
|
-
|
|
112
|
-
---
|
|
113
|
-
|
|
114
|
-
## ⚙️ 配置参数参考 (`settings.yaml`)
|
|
115
|
-
|
|
116
|
-
```yaml
|
|
117
|
-
dsh-goal:
|
|
118
|
-
maxIterations: 25
|
|
119
|
-
autoDrive: true
|
|
120
|
-
enableSound: true
|
|
121
|
-
```
|
|
122
|
-
|
|
123
|
-
| 参数项 | 类型 | 默认值 | 说明 |
|
|
124
|
-
|:---|:---|:---|:---|
|
|
125
|
-
| `maxIterations` | `number` | `25` | 安全熔断阈值:单目标允许的最大自主轮次 |
|
|
126
|
-
| `autoDrive` | `boolean` | `true` | 是否在轮次结束后自动驱动智能体继续推进 |
|
|
127
|
-
| `enableSound` | `boolean` | `true` | 目标完成时是否播放提示音效 |
|
|
128
|
-
|
|
129
|
-
---
|
|
130
|
-
|
|
131
|
-
## 🧪 自动化测试
|
|
132
|
-
|
|
133
|
-
运行自动化测试套件:
|
|
134
|
-
|
|
135
|
-
```bash
|
|
136
|
-
npm test
|
|
137
|
-
```
|
|
138
|
-
|
|
139
|
-
---
|
|
140
|
-
|
|
141
|
-
## 📄 许可证
|
|
142
|
-
|
|
143
|
-
MIT © [GooDAnDReaDY](https://github.com/GooDAnDReaDY)
|