harness-async 0.1.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 +21 -0
- package/README.md +152 -0
- package/dist/dashboard/assets/index-TGNGdtwt.js +246 -0
- package/dist/dashboard/assets/index-f4TpA4iP.css +1 -0
- package/dist/dashboard/index.html +13 -0
- package/dist/src/adapters/claude-adapter.js +52 -0
- package/dist/src/adapters/codex-adapter.js +55 -0
- package/dist/src/adapters/index.js +14 -0
- package/dist/src/adapters/shared.js +74 -0
- package/dist/src/cli/commands/daemon.js +116 -0
- package/dist/src/cli/commands/doctor.js +50 -0
- package/dist/src/cli/commands/hook.js +188 -0
- package/dist/src/cli/commands/init.js +22 -0
- package/dist/src/cli/commands/run.js +129 -0
- package/dist/src/cli/commands/schedule.js +105 -0
- package/dist/src/cli/commands/task.js +188 -0
- package/dist/src/cli/index.js +23 -0
- package/dist/src/cli/utils/notify.js +32 -0
- package/dist/src/cli/utils/output.js +94 -0
- package/dist/src/core/daemon.js +375 -0
- package/dist/src/core/dag.js +80 -0
- package/dist/src/core/event-log.js +34 -0
- package/dist/src/core/lock.js +25 -0
- package/dist/src/core/run-manager.js +265 -0
- package/dist/src/core/run-orchestrator.js +193 -0
- package/dist/src/core/scheduler.js +106 -0
- package/dist/src/core/sessions.js +48 -0
- package/dist/src/core/store.js +225 -0
- package/dist/src/core/task-manager.js +375 -0
- package/dist/src/core/tmux.js +51 -0
- package/dist/src/daemon.js +35 -0
- package/dist/src/dashboard/routes.js +107 -0
- package/dist/src/dashboard/server.js +142 -0
- package/dist/src/dashboard/ws.js +75 -0
- package/dist/src/types/adapter.js +30 -0
- package/dist/src/types/index.js +87 -0
- package/package.json +65 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Junhao Zhuo
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
# harness-async
|
|
2
|
+
|
|
3
|
+
`harness-async` 是 `ha`(harness-agent)的设计与规划仓库。项目目标是构建一个 Agent-first 的 CLI 工具和本地 Web Dashboard,用于支持人类与多个 agent 之间的异步分层协作。
|
|
4
|
+
|
|
5
|
+
当前仓库同时承载两类资产:
|
|
6
|
+
|
|
7
|
+
- 设计文档:架构、MVP、路线图和 phase 计划。
|
|
8
|
+
- 可运行实现:TypeScript CLI、守护进程、Dashboard 和测试。
|
|
9
|
+
|
|
10
|
+
设计文档仍然是项目共识来源,但仓库已经不再只是规划稿。
|
|
11
|
+
|
|
12
|
+
## 项目要解决的问题
|
|
13
|
+
|
|
14
|
+
项目希望把复杂工作拆成可编排、可追踪、可回溯的任务流,让人类只在真正需要介入时介入,把更多执行工作交给 agent。
|
|
15
|
+
|
|
16
|
+
核心设计围绕以下几点展开:
|
|
17
|
+
|
|
18
|
+
- Agent-first:CLI 的主要用户是 agent,不是人。
|
|
19
|
+
- 分层协作:任务按 L1、L2、L3 区分自治执行、人工监督和人工主导。
|
|
20
|
+
- DAG 编排:任务之间可以声明依赖关系,支持解锁、调度和可视化。
|
|
21
|
+
- 双层存储:同时支持项目级任务和全局级任务。
|
|
22
|
+
- 可视化与审计:通过 Dashboard、事件日志和运行记录追踪全过程。
|
|
23
|
+
|
|
24
|
+
## 当前状态
|
|
25
|
+
|
|
26
|
+
仓库当前已经包含可运行的 `ha` 原型实现,覆盖任务管理、
|
|
27
|
+
守护进程、Dashboard、`ha run` 和对应测试。文档与规格仍然需要和
|
|
28
|
+
实现保持同步,因此阅读代码前仍然建议先看 `docs/` 与 `specs/`。
|
|
29
|
+
|
|
30
|
+
现有文档覆盖了以下主题:
|
|
31
|
+
|
|
32
|
+
- 架构设计:定义系统边界、存储模型、CLI 设计和核心数据结构。
|
|
33
|
+
- MVP 定义:明确第一阶段做什么、不做什么,以及关键用户流程。
|
|
34
|
+
- Roadmap:拆分 Phase 0 到 Phase 3 的演进路径和关键技术决策。
|
|
35
|
+
- Phase 计划:把每个阶段进一步细化为可执行任务列表和验收标准。
|
|
36
|
+
|
|
37
|
+
## 仓库结构
|
|
38
|
+
|
|
39
|
+
仓库当前以文档为主,目录职责如下:
|
|
40
|
+
|
|
41
|
+
```text
|
|
42
|
+
.
|
|
43
|
+
├── docs/
|
|
44
|
+
│ ├── 01-architecture.md
|
|
45
|
+
│ ├── 02-mvp.md
|
|
46
|
+
│ └── 03-roadmap.md
|
|
47
|
+
├── specs/
|
|
48
|
+
│ ├── AGENTS.md
|
|
49
|
+
│ └── active/
|
|
50
|
+
│ ├── phase0-scaffold-plan.md
|
|
51
|
+
│ ├── phase1-mvp-plan.md
|
|
52
|
+
│ └── phase2-agent-integration-plan.md
|
|
53
|
+
└── LICENSE
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
- `docs/`:项目级设计文档,回答"这是什么、为什么这样设计、计划怎么演进"。
|
|
57
|
+
- `specs/`:实施计划和工作规范,回答"接下来按什么顺序落地、每一步如何验收"。
|
|
58
|
+
- `specs/AGENTS.md`:只约束 `specs/` 目录内设计与计划文档的编写规范。
|
|
59
|
+
- `LICENSE`:开源许可。
|
|
60
|
+
|
|
61
|
+
后续如果开始实现,预计会新增实际代码目录,例如 `ha/`、`src/`、`skills/` 或其他运行时相关结构。
|
|
62
|
+
|
|
63
|
+
## 安装与试用
|
|
64
|
+
|
|
65
|
+
如果你只想在本机试用 `ha` CLI,先确保本地环境满足 Node.js 20+
|
|
66
|
+
和 npm 10+。这个项目发布后的命令名是 `ha`,包名是
|
|
67
|
+
`harness-async`。
|
|
68
|
+
|
|
69
|
+
本地开发安装:
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
npm install
|
|
73
|
+
npm run build
|
|
74
|
+
npm link
|
|
75
|
+
ha --help
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
全局安装已发布版本:
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
npm install -g harness-async
|
|
82
|
+
ha init
|
|
83
|
+
ha doctor
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
免全局安装的临时运行方式:
|
|
87
|
+
|
|
88
|
+
```bash
|
|
89
|
+
npx -y -p harness-async ha init
|
|
90
|
+
npx -y -p harness-async ha doctor
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
如果你希望命令写成 `npx ha@latest ...`,那需要 npm 上存在名为
|
|
94
|
+
`ha` 的包,或者改成你自己的 scope 包名,例如 `@your-scope/ha`。
|
|
95
|
+
|
|
96
|
+
## 发布到 npm
|
|
97
|
+
|
|
98
|
+
如果你要把这个 CLI 发布给别人安装,先确认构建、测试和打包都通过。
|
|
99
|
+
当前仓库已经配置了 `prepublishOnly`,执行 `npm publish` 前会自动跑
|
|
100
|
+
构建和测试。
|
|
101
|
+
|
|
102
|
+
最小发布流程:
|
|
103
|
+
|
|
104
|
+
```bash
|
|
105
|
+
npm login
|
|
106
|
+
npm publish
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
发布前建议先做一次本地打包检查:
|
|
110
|
+
|
|
111
|
+
```bash
|
|
112
|
+
npm run build
|
|
113
|
+
npm pack --dry-run
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
发布后可用下面的命令验证:
|
|
117
|
+
|
|
118
|
+
```bash
|
|
119
|
+
npm install -g harness-async
|
|
120
|
+
ha --help
|
|
121
|
+
ha init
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
## 建议阅读顺序
|
|
125
|
+
|
|
126
|
+
如果你是第一次接触这个仓库,建议按下面顺序阅读:
|
|
127
|
+
|
|
128
|
+
1. 阅读 [`docs/01-architecture.md`](docs/01-architecture.md),理解项目定位、核心架构和关键设计选择。
|
|
129
|
+
2. 阅读 [`docs/02-mvp.md`](docs/02-mvp.md),了解 MVP 范围、优先级和典型用户流程。
|
|
130
|
+
3. 阅读 [`docs/03-roadmap.md`](docs/03-roadmap.md),建立阶段性认知和技术决策上下文。
|
|
131
|
+
4. 根据当前工作目标,进入 `specs/active/` 阅读对应 phase 的计划文档。
|
|
132
|
+
|
|
133
|
+
## 文档与计划的关系
|
|
134
|
+
|
|
135
|
+
这个仓库中的文档分为两层:
|
|
136
|
+
|
|
137
|
+
- `docs/` 记录稳定的产品与架构共识。
|
|
138
|
+
- `specs/active/` 记录可执行的阶段性实施计划。
|
|
139
|
+
|
|
140
|
+
如果后续发生设计变化,通常需要先更新 `docs/`,再同步更新关联的 `specs/` 文档,避免计划与架构描述脱节。
|
|
141
|
+
|
|
142
|
+
## 适合谁使用
|
|
143
|
+
|
|
144
|
+
这个仓库主要服务三类读者:
|
|
145
|
+
|
|
146
|
+
- 设计实现 `ha` 的开发者和 agent。
|
|
147
|
+
- 需要理解产品边界和技术路线的协作者。
|
|
148
|
+
- 未来会为 `ha` 编写 skill、adapter 或 dashboard 的贡献者。
|
|
149
|
+
|
|
150
|
+
## 下一步
|
|
151
|
+
|
|
152
|
+
下一阶段的自然工作是根据 `specs/active/` 中的计划启动脚手架实现,并在实现过程中持续把设计、计划和代码保持同步。
|