dsh-issue2pr 0.1.0 → 0.3.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 +21 -3
- package/client.js +466 -76
- package/index.js +63 -0
- package/lib/agents.js +204 -0
- package/lib/stages/p6-coder.js +14 -7
- package/package.json +37 -8
package/README.md
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
<img src="docs/assets/banner.svg" alt="dsh-issue2pr — 从一条 Issue 到一份被合并的 PR,中间不能跳步" width="100%">
|
|
3
3
|
<p>
|
|
4
4
|
<a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-2A3F7A?style=flat-square" alt="License: MIT"></a>
|
|
5
|
+
<a href="https://www.npmjs.com/package/dsh-issue2pr"><img src="https://img.shields.io/npm/v/dsh-issue2pr?style=flat-square&color=506B3A" alt="npm version"></a>
|
|
5
6
|
<img src="https://img.shields.io/badge/node-%E2%89%A5%2018-506B3A?style=flat-square&logo=nodedotjs&logoColor=white" alt="Node ≥ 18">
|
|
6
7
|
<img src="https://img.shields.io/badge/host-DSH%20%E6%8F%92%E4%BB%B6-A07A1F?style=flat-square" alt="DSH 插件">
|
|
7
8
|
<img src="https://img.shields.io/badge/pipeline-11%20stages%20%C2%B7%204%20gates-2A3F7A?style=flat-square" alt="11 stages · 4 review gates">
|
|
@@ -86,6 +87,14 @@
|
|
|
86
87
|
| `session` | 生成任务包交给 DSH 会话执行,人工完成后通过复核门放行 |
|
|
87
88
|
| `claude` | 任务包自动委托 Claude Code CLI 无人值守执行(`--add-dir` 写产物目录,停止/删除时杀进程树),失败回退等人工会话 |
|
|
88
89
|
|
|
90
|
+
### 委外智能体:多方式发现 + 测试门禁
|
|
91
|
+
|
|
92
|
+
选 `claude` 模式后,项目页与配置页出现「委外智能体」绑定卡:
|
|
93
|
+
|
|
94
|
+
- **多方式发现**:自动扫描五种来源并去重合并——项目配置 > 环境变量 `ISSUE2PR_CLAUDE_BIN` > 常见安装位置 > `npm config get prefix` 全局目录 > PATH 查找;也可手动指定完整路径(留空 = 自动探测)。
|
|
95
|
+
- **测试门禁**:点「测试门禁」真实跑一次极小调用,三步全绿(定位 → `--version` → 认证微任务)才能保存——`403 IP access denied by API-Key restrictions`、未登录这类认证错误在**绑定时**就拦截并给出处置提示(IP 白名单 / 登录 / 代理出口),而不是等 Run 走到 P6 才失败回退。微任务仅一轮、几十 token,费用可忽略。
|
|
96
|
+
- 改过绑定路径后门禁结果即失效,需重测;服务端保存时另有 `--version` 级快检兜底(拦路径写错 / 未安装)。
|
|
97
|
+
|
|
89
98
|
## 🚀 快速开始
|
|
90
99
|
|
|
91
100
|
### 环境要求
|
|
@@ -97,16 +106,22 @@
|
|
|
97
106
|
|
|
98
107
|
### 安装
|
|
99
108
|
|
|
100
|
-
|
|
109
|
+
已发布到 npm(推荐——预构建包,无需授权构建脚本):
|
|
110
|
+
|
|
111
|
+
```bash
|
|
112
|
+
dsh plugin --profile web add dsh-issue2pr
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
或从源码安装——把本插件克隆进 DSH 插件目录,然后重启 DSH:
|
|
101
116
|
|
|
102
117
|
```bash
|
|
103
118
|
# Windows: C:\Users\<you>\.dsh\plugins\
|
|
104
119
|
# macOS / Linux: ~/.dsh/plugins/
|
|
105
120
|
cd ~/.dsh/plugins
|
|
106
|
-
git clone https://github.com/LONGSASASASASA/dsh-
|
|
121
|
+
git clone https://github.com/LONGSASASASASA/dsh-issue2pr.git dsh-issue2pr
|
|
107
122
|
```
|
|
108
123
|
|
|
109
|
-
> 也可以通过 [dsh-plugin-manager](https://github.com/LONGSASASASASA)
|
|
124
|
+
> 也可以通过 [dsh-plugin-manager](https://github.com/LONGSASASASASA) 插件安装与管理;审阅源码后可用 `dsh plugin --profile web add github:LONGSASASASASA/dsh-issue2pr#<commit>` 锁定 commit 安装。数据默认存放在 `~/.dsh/issue2pr/`(与插件目录分离,升级插件不丢数据)。
|
|
110
125
|
|
|
111
126
|
### 五分钟跑通第一单
|
|
112
127
|
|
|
@@ -234,6 +249,8 @@ git clone https://github.com/LONGSASASASASA/dsh-issue2PR.git dsh-issue2pr
|
|
|
234
249
|
| POST | `/issue2pr/api/connections/test` | 凭据探活 |
|
|
235
250
|
| POST | `/issue2pr/api/connections/test-repo` | 真实仓库连通性(`git ls-remote`) |
|
|
236
251
|
| GET | `/issue2pr/api/preflight` | 环境健康探测(git / claude CLI / LLM 路由来源) |
|
|
252
|
+
| GET | `/issue2pr/api/agents/discover?slug=` | 委外智能体多方式发现(配置/env/常见位置/npm 前缀/PATH) |
|
|
253
|
+
| POST | `/issue2pr/api/agents/test` | 委外智能体测试门禁(定位 → 版本 → 认证微任务) |
|
|
237
254
|
| POST | `/issue2pr/api/check-local` | 本地触发源存在性 |
|
|
238
255
|
| POST | `/issue2pr/api/assistant/ask` | 悬浮助手问答(NDJSON 流式) |
|
|
239
256
|
| GET/POST | `/issue2pr/api/projects` | 项目列表 / 保存 |
|
|
@@ -260,6 +277,7 @@ npm test # node --test,覆盖 API / 流水线 / 各阶段执行器 /
|
|
|
260
277
|
| `lib/stages/p1…p11` | 11 个阶段执行器(输入契约 → 产物落盘) |
|
|
261
278
|
| `lib/llm.js` | LLM 路由解析 + JSON 契约解析(失败重试一次) |
|
|
262
279
|
| `lib/connections.js` | 托管连接、凭据注入与脱敏 |
|
|
280
|
+
| `lib/agents.js` | 委外智能体发现与测试门禁 |
|
|
263
281
|
| `lib/store.js` | 目录规则与产物读写(唯一允许写盘的地方) |
|
|
264
282
|
| `lib/assistant.js` | 智能助手上下文聚合 |
|
|
265
283
|
| `tests/` | 单测 + `e2e-live.mjs` 真实链路演练 |
|