homeagent-runner 0.4.18 → 0.4.20
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 +31 -0
- package/README.md +8 -7
- package/README.zh-CN.md +24 -23
- package/dist/runner/context.js +11 -1
- package/dist/runner/memory.js +169 -0
- package/dist/runner/tools.js +36 -7
- package/dist/shared/protocol.js +1 -1
- package/dist/shared/tools.js +13 -1
- package/docs/ARCHITECTURE.md +46 -44
- package/docs/ARCHITECTURE.zh-CN.md +102 -0
- package/docs/CLIENTS.md +38 -36
- package/docs/CLIENTS.zh-CN.md +132 -0
- package/docs/COMPARISON.md +24 -22
- package/docs/COMPARISON.zh-CN.md +38 -0
- package/docs/DEPLOYMENT.md +119 -106
- package/docs/DEPLOYMENT.zh-CN.md +316 -0
- package/docs/DEVELOPMENT_WORKFLOW.md +41 -39
- package/docs/DEVELOPMENT_WORKFLOW.zh-CN.md +128 -0
- package/docs/OPEN_SOURCE.md +69 -65
- package/docs/OPEN_SOURCE.zh-CN.md +133 -0
- package/docs/README.md +24 -20
- package/docs/README.zh-CN.md +31 -0
- package/docs/REMOTE_ASSIST.md +31 -29
- package/docs/REMOTE_ASSIST.zh-CN.md +48 -0
- package/docs/TOOLS.md +146 -84
- package/docs/TOOLS.zh-CN.md +174 -0
- package/docs/VALIDATION.md +114 -107
- package/docs/VALIDATION.zh-CN.md +179 -0
- package/docs/WEBCODEX_CODE_AUDIT.md +81 -79
- package/docs/WEBCODEX_CODE_AUDIT.zh-CN.md +109 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,36 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.4.20 — Project memory and authorized Kanban coordination
|
|
4
|
+
|
|
5
|
+
- Add six server-side Kanban tools for task creation, claiming, progress updates,
|
|
6
|
+
review submission and completion, with device/project-scoped OAuth and PAT checks.
|
|
7
|
+
Offline access still requires an authorized, non-revoked, non-paused device;
|
|
8
|
+
claiming resolves an unambiguous device rather than recording an empty assignee.
|
|
9
|
+
- Renew 30-minute task leases from the assigned worker's device/project activity,
|
|
10
|
+
record successful non-preview file mutations in `actualPaths`, and attach advisory
|
|
11
|
+
warnings when file tools touch paths awaiting review without changing their receipts.
|
|
12
|
+
- Add optional local project charters and glob-matched pitfall hints to project context
|
|
13
|
+
and single/batch file tools. Discover the workspace through an environment override,
|
|
14
|
+
a sibling `workspace.json`, or the default local workspace directory.
|
|
15
|
+
- Harden memory reads against invalid project IDs, traversal, Windows path aliases,
|
|
16
|
+
symlinks/junctions, hard links and malformed indexes; bound reads and preserve UTF-8
|
|
17
|
+
boundaries with accurate byte-based charter truncation metadata.
|
|
18
|
+
- Normalize Windows and relative paths for memory matching and Kanban path tracking;
|
|
19
|
+
expand the MCP catalog to 51 tools and add authorization, lease, receipt, memory
|
|
20
|
+
boundary and cross-platform regression coverage.
|
|
21
|
+
|
|
22
|
+
## 0.4.19 — XAuth OIDC administrator login and sole-administrator binding
|
|
23
|
+
|
|
24
|
+
- Add optional self-hosted [XAuth](https://github.com/jhxxr/XAuth) OIDC administrator
|
|
25
|
+
login (`XAUTH_ISSUER`, `XAUTH_CLIENT_ID`, `XAUTH_CLIENT_SECRET`) with `S256` PKCE,
|
|
26
|
+
server-stored signed state, nonce validation, JWKS caching/rotation and `RS256` ID
|
|
27
|
+
token verification, supporting XAuth-only or dual XAuth + `ADMIN_PASSWORD` sign-in.
|
|
28
|
+
- Automatically bind the first authenticated XAuth account (`sub`) in SQLite as the
|
|
29
|
+
workspace's sole administrator and reject all subsequent XAuth accounts (`403`),
|
|
30
|
+
surfacing the bound administrator identity and session auth method in the Dashboard.
|
|
31
|
+
- Provide aligned English and Simplified Chinese documentation across all 11 guides
|
|
32
|
+
under `docs/` alongside `README.md` and `README.zh-CN.md`.
|
|
33
|
+
|
|
3
34
|
## 0.4.18 — Windows PowerShell persistent shell bootstrap
|
|
4
35
|
|
|
5
36
|
- Initialize persistent Windows PowerShell sessions with an explicit `-NonInteractive -EncodedCommand`
|
package/README.md
CHANGED
|
@@ -59,8 +59,8 @@ flowchart TB
|
|
|
59
59
|
```
|
|
60
60
|
|
|
61
61
|
- **Protocol Compatibility**: Built on the official MCP SDK v2 (`Streamable HTTP` at `/mcp`), supporting both `2026-07-28` discovery/envelopes and `2025` legacy protocol clients.
|
|
62
|
-
- **Authentication**: Supports OAuth 2.1 authorization-code flow with `S256` PKCE, scoped Personal Access Tokens (`Bearer`), and one-time browser or pairing-code device enrollment.
|
|
63
|
-
- **Release Scope**: Current release **v0.4.
|
|
62
|
+
- **Authentication**: Supports Web Dashboard sign-in via admin password or [XAuth](https://github.com/jhxxr/XAuth) OIDC (binding the first XAuth account as the sole administrator), plus OAuth 2.1 authorization-code flow with `S256` PKCE, scoped Personal Access Tokens (`Bearer`), and one-time browser or pairing-code device enrollment.
|
|
63
|
+
- **Release Scope**: Current release **v0.4.20** supports a single administrator and multiple devices/projects. Persistent interactive PTY shells, detached jobs surviving runner replacement, automatic worktree registration, and preview tunnels are intentionally out of scope.
|
|
64
64
|
|
|
65
65
|
## Interface Preview
|
|
66
66
|
|
|
@@ -116,7 +116,7 @@ Follow this sequence: **1. Deploy the Server → 2. Pair a Runner → 3. Connect
|
|
|
116
116
|
Requires Docker Engine, Docker Compose v2, and Git. Point your domain's DNS record to the server and open inbound TCP ports `80` and `443`. Replace `mcp.example.com` below with your own domain:
|
|
117
117
|
|
|
118
118
|
```sh
|
|
119
|
-
git clone --branch v0.4.
|
|
119
|
+
git clone --branch v0.4.20 --depth 1 https://github.com/jhxxr/HomeAgent.git
|
|
120
120
|
cd HomeAgent
|
|
121
121
|
|
|
122
122
|
# Generate random ADMIN_PASSWORD and SESSION_SECRET in .env without installing Node.js on the host
|
|
@@ -155,7 +155,7 @@ homeagent-server
|
|
|
155
155
|
```
|
|
156
156
|
|
|
157
157
|
- **Local Access**: Open `http://localhost:3210` and sign in using the `ADMIN_PASSWORD` written to `.env` in the current working directory. SQLite data is stored at `data/server.sqlite`.
|
|
158
|
-
- **Public Access**: Set `PUBLIC_URL=https://mcp.example.com` and `TRUST_PROXY_HOPS=1` in `.env`, then reverse-proxy traffic to `127.0.0.1:3210`. Use `systemd` or a process manager for background execution (see [Native Server Deployment](docs/DEPLOYMENT.md
|
|
158
|
+
- **Public Access**: Set `PUBLIC_URL=https://mcp.example.com` and `TRUST_PROXY_HOPS=1` in `.env`, then reverse-proxy traffic to `127.0.0.1:3210`. Use `systemd` or a process manager for background execution (see [Native Server Deployment](docs/DEPLOYMENT.md#native-server-deployment)).
|
|
159
159
|
|
|
160
160
|
### 2. Install & Pair a Runner
|
|
161
161
|
|
|
@@ -189,7 +189,7 @@ homeagent
|
|
|
189
189
|
|
|
190
190
|
- **OAuth 2.1**: Point your MCP client to `https://mcp.example.com/mcp` and approve the requested device, project, and scope permissions in your browser.
|
|
191
191
|
- **Personal Access Token (`Bearer`)**: Issue a scoped token (`read`, `write`, `execute`, `git`) in the Dashboard and configure your client with `Authorization: Bearer <token>`.
|
|
192
|
-
- **Version Alignment**: Keep `homeagent-server` and `homeagent-runner` on the same release (`v0.4.
|
|
192
|
+
- **Version Alignment**: Keep `homeagent-server` and `homeagent-runner` on the same release (`v0.4.20`). Check versions anytime with `homeagent-server --version`, `homeagent --version`, or in the Dashboard header.
|
|
193
193
|
- **Client Guides**: See [Connecting AI Clients](docs/CLIENTS.md) for step-by-step instructions across Claude, ChatGPT, Cursor, and the MCP SDK.
|
|
194
194
|
|
|
195
195
|
## AI Prompting Guide
|
|
@@ -263,7 +263,7 @@ Need a collaborator or teammate's AI agent to help debug a machine without givin
|
|
|
263
263
|
|
|
264
264
|
## MCP Tools
|
|
265
265
|
|
|
266
|
-
###
|
|
266
|
+
### 51 Built-In Tools
|
|
267
267
|
|
|
268
268
|
| Category | Tools |
|
|
269
269
|
| --- | --- |
|
|
@@ -271,6 +271,7 @@ Need a collaborator or teammate's AI agent to help debug a machine without givin
|
|
|
271
271
|
| **Files & Code Editing** | `list_directory`, `read_file`, `read_files`, `write_file`, `create_directory`, `move_file`, `get_file_info`, `search_files`, `edit_block`, `edit_files`, `apply_unified_diff`, `get_edit_transactions`, `recover_edit_transaction` |
|
|
272
272
|
| **LSP & Code Intelligence** | `lsp_document_symbols`, `lsp_workspace_symbols`, `lsp_definition`, `lsp_references`, `lsp_hover`, `lsp_diagnostics` |
|
|
273
273
|
| **Processes & Persistent Shells** | `start_process`, `run_command`, `wait_process`, `read_process_output`, `tail_process_output`, `write_process_input`, `list_processes`, `stop_process`, `start_shell`, `run_shell`, `list_shells`, `stop_shell` |
|
|
274
|
+
| **Project Kanban** | `kanban_list_tasks`, `kanban_create_task`, `kanban_claim_task`, `kanban_update_task`, `kanban_submit_review`, `kanban_complete_task` |
|
|
274
275
|
| **Git Workflow** | `git_status`, `git_diff`, `git_log`, `git_add`, `git_commit`, `git_commit_paths`, `git_branches`, `git_switch_branch`, `git_fetch`, `git_pull`, `git_push` |
|
|
275
276
|
|
|
276
277
|
Every machine tool targets an explicit `projectId` (and requires `deviceId` whenever multiple authorized devices are online). Processes are tracked by job UUIDs owned by the initiating client principal and project—never arbitrary OS PIDs—and supervised via Linux process groups or Windows Job Objects. See [Development Workflow](docs/DEVELOPMENT_WORKFLOW.md) and [Tool Reference](docs/TOOLS.md).
|
|
@@ -299,7 +300,7 @@ runtime/ # Windows Job Object process-tree supervisor sources
|
|
|
299
300
|
licenses/ # Locked runtime dependency license notices
|
|
300
301
|
```
|
|
301
302
|
|
|
302
|
-
*Note: Detailed operational guides in `docs/` are
|
|
303
|
+
*Note: Detailed operational guides in `docs/` are available in both English (canonical, unsuffixed files) and Simplified Chinese (`.zh-CN.md` files), using identical CLI commands and configuration keys across platforms.*
|
|
303
304
|
|
|
304
305
|
| Guide | Description |
|
|
305
306
|
| --- | --- |
|
package/README.zh-CN.md
CHANGED
|
@@ -26,9 +26,9 @@
|
|
|
26
26
|
<a href="#ai-远程开发教程与提示词模板">提示词教程</a> ·
|
|
27
27
|
<a href="#远程协助">远程协助</a> ·
|
|
28
28
|
<a href="#mcp-工具">MCP 工具</a> ·
|
|
29
|
-
<a href="docs/DEPLOYMENT.md">部署指南</a> ·
|
|
30
|
-
<a href="docs/CLIENTS.md">AI 客户端</a> ·
|
|
31
|
-
<a href="docs/README.md">完整文档</a> ·
|
|
29
|
+
<a href="docs/DEPLOYMENT.zh-CN.md">部署指南</a> ·
|
|
30
|
+
<a href="docs/CLIENTS.zh-CN.md">AI 客户端</a> ·
|
|
31
|
+
<a href="docs/README.zh-CN.md">完整文档</a> ·
|
|
32
32
|
<a href="CHANGELOG.md">更新日志</a>
|
|
33
33
|
</p>
|
|
34
34
|
|
|
@@ -59,8 +59,8 @@ flowchart TB
|
|
|
59
59
|
```
|
|
60
60
|
|
|
61
61
|
- **协议兼容**:基于 MCP 官方 SDK v2 实现 Streamable HTTP(`/mcp`),同时支持 `2026-07-28` 发现与信封规范及 `2025` 协议兼容。
|
|
62
|
-
-
|
|
63
|
-
- **版本边界**:当前版本 **v0.4.
|
|
62
|
+
- **认证体系**:控制台支持管理员密码与 [XAuth](https://github.com/jhxxr/XAuth) OIDC 登录(首个登录的 XAuth 账号自动绑定为唯一管理员);客户端支持带 `S256` PKCE 的 OAuth 2.1 授权码流程、按范围受限的 Bearer 令牌(PAT),以及浏览器/配对码一次性设备绑定。
|
|
63
|
+
- **版本边界**:当前版本 **v0.4.20** 支持单管理员、多设备与多项目。持久交互式 PTY 终端、跨 Runner 重启保留脱离进程、自动 worktree 注册及预览隧道不在当前实现范围内。
|
|
64
64
|
|
|
65
65
|
## 界面预览
|
|
66
66
|
|
|
@@ -116,7 +116,7 @@ Server 与 Runner 拆分为两个独立的 npm 包,分别安装在中继服务
|
|
|
116
116
|
准备 Docker Engine、Docker Compose v2 和 Git,将域名解析到服务器并放行 TCP `80` / `443` 端口。将下方示例中的 `mcp.example.com` 替换为你的域名:
|
|
117
117
|
|
|
118
118
|
```sh
|
|
119
|
-
git clone --branch v0.4.
|
|
119
|
+
git clone --branch v0.4.20 --depth 1 https://github.com/jhxxr/HomeAgent.git
|
|
120
120
|
cd HomeAgent
|
|
121
121
|
|
|
122
122
|
# 使用容器生成随机密码和会话密钥,无需在宿主机安装 Node.js
|
|
@@ -141,7 +141,7 @@ docker compose --profile proxy ps
|
|
|
141
141
|
curl --fail https://mcp.example.com/health
|
|
142
142
|
```
|
|
143
143
|
|
|
144
|
-
Caddy 会自动申请 TLS 证书并代理 HTTP 与 WebSocket。浏览器打开 `https://mcp.example.com`,使用 `.env` 中的 `ADMIN_PASSWORD` 登录控制台。`3210` 端口仅绑定宿主机 `127.0.0.1`,SQLite 数据保存在 `server-data` 命名卷中。备份、升级与现有 Nginx 反代配置详见 [部署指南](docs/DEPLOYMENT.md)。
|
|
144
|
+
Caddy 会自动申请 TLS 证书并代理 HTTP 与 WebSocket。浏览器打开 `https://mcp.example.com`,使用 `.env` 中的 `ADMIN_PASSWORD` 登录控制台。`3210` 端口仅绑定宿主机 `127.0.0.1`,SQLite 数据保存在 `server-data` 命名卷中。备份、升级与现有 Nginx 反代配置详见 [部署指南](docs/DEPLOYMENT.zh-CN.md)。
|
|
145
145
|
|
|
146
146
|
#### 方式 B:npm 原生运行(适合 Linux / Windows 本机试用或已有 Node.js 环境)
|
|
147
147
|
|
|
@@ -155,7 +155,7 @@ homeagent-server
|
|
|
155
155
|
```
|
|
156
156
|
|
|
157
157
|
- **本机访问**:打开 `http://localhost:3210`,管理员密码位于当前目录 `.env` 的 `ADMIN_PASSWORD` 中,SQLite 默认保存在 `data/server.sqlite`。
|
|
158
|
-
- **公网访问**:将 `.env` 中的 `PUBLIC_URL` 改为固定 HTTPS 域名并设置 `TRUST_PROXY_HOPS=1`,再通过 Nginx / Caddy 反代至 `127.0.0.1:3210`。长期后台运行可配置 `systemd`(见 [原生部署 Server](docs/DEPLOYMENT.md#原生部署-server))。
|
|
158
|
+
- **公网访问**:将 `.env` 中的 `PUBLIC_URL` 改为固定 HTTPS 域名并设置 `TRUST_PROXY_HOPS=1`,再通过 Nginx / Caddy 反代至 `127.0.0.1:3210`。长期后台运行可配置 `systemd`(见 [原生部署 Server](docs/DEPLOYMENT.zh-CN.md#原生部署-server))。
|
|
159
159
|
|
|
160
160
|
### 2. 安装并配对 Runner
|
|
161
161
|
|
|
@@ -189,8 +189,8 @@ homeagent
|
|
|
189
189
|
|
|
190
190
|
- **OAuth 2.1 连接**:在 MCP 客户端填入 `https://mcp.example.com/mcp`,在弹出的浏览器页面中勾选允许访问的设备、项目与权限范围。
|
|
191
191
|
- **Bearer 令牌(PAT)连接**:在控制台为已配对设备签发指定 `read / write / execute / git` 范围的客户端令牌,并以 `Authorization: Bearer <token>` 方式接入。
|
|
192
|
-
- **版本一致性**:升级时请保持 `homeagent-server` 与 `homeagent-runner` 版本一致(`v0.4.
|
|
193
|
-
- **客户端配置详情**:各客户端完整接入步骤见 [AI 客户端连接指南](docs/CLIENTS.md)。
|
|
192
|
+
- **版本一致性**:升级时请保持 `homeagent-server` 与 `homeagent-runner` 版本一致(`v0.4.20`),可通过 `homeagent-server --version`、`homeagent --version` 或控制台顶部查看。
|
|
193
|
+
- **客户端配置详情**:各客户端完整接入步骤见 [AI 客户端连接指南](docs/CLIENTS.zh-CN.md)。
|
|
194
194
|
|
|
195
195
|
## AI 远程开发教程与提示词模板
|
|
196
196
|
|
|
@@ -259,11 +259,11 @@ homeagent
|
|
|
259
259
|
homeagent assist "https://mcp.example.com/assist#id=...&token=..."
|
|
260
260
|
```
|
|
261
261
|
3. **本机逐项审批**:设备持有人在本地 Runner 中添加 **1–16 个项目目录**,逐项目设置只读/文件写入与可执行程序白名单,并选择统一时长(30 分钟 / 2 小时 / 8 小时)。
|
|
262
|
-
4. **随时立即停止**:仅在本机最终批准后才开放访问;本机点击「立即停止」、退出、到期或断线都会立刻终止全部托管任务并收回访问。详见 [远程协助指南](docs/REMOTE_ASSIST.md)。
|
|
262
|
+
4. **随时立即停止**:仅在本机最终批准后才开放访问;本机点击「立即停止」、退出、到期或断线都会立刻终止全部托管任务并收回访问。详见 [远程协助指南](docs/REMOTE_ASSIST.zh-CN.md)。
|
|
263
263
|
|
|
264
264
|
## MCP 工具
|
|
265
265
|
|
|
266
|
-
###
|
|
266
|
+
### 51 个已实现工具
|
|
267
267
|
|
|
268
268
|
| 类别 | 工具列表 |
|
|
269
269
|
| --- | --- |
|
|
@@ -271,9 +271,10 @@ homeagent
|
|
|
271
271
|
| **文件与代码编辑** | `list_directory`, `read_file`, `read_files`, `write_file`, `create_directory`, `move_file`, `get_file_info`, `search_files`, `edit_block`, `edit_files`, `apply_unified_diff`, `get_edit_transactions`, `recover_edit_transaction` |
|
|
272
272
|
| **LSP 与代码智能** | `lsp_document_symbols`, `lsp_workspace_symbols`, `lsp_definition`, `lsp_references`, `lsp_hover`, `lsp_diagnostics` |
|
|
273
273
|
| **进程与持久终端** | `start_process`, `run_command`, `wait_process`, `read_process_output`, `tail_process_output`, `write_process_input`, `list_processes`, `stop_process`, `start_shell`, `run_shell`, `list_shells`, `stop_shell` |
|
|
274
|
+
| **项目看板** | `kanban_list_tasks`, `kanban_create_task`, `kanban_claim_task`, `kanban_update_task`, `kanban_submit_review`, `kanban_complete_task` |
|
|
274
275
|
| **Git 工作流** | `git_status`, `git_diff`, `git_log`, `git_add`, `git_commit`, `git_commit_paths`, `git_branches`, `git_switch_branch`, `git_fetch`, `git_pull`, `git_push` |
|
|
275
276
|
|
|
276
|
-
所有机器工具均通过 `projectId` 指定项目(当多台已授权设备同时在线时还须指定 `deviceId`)。进程采用由启动客户端主体和项目共同拥有的任务 UUID(不接受任意系统 PID),并通过 Linux 进程组或 Windows Job Object 管理子孙进程。详见 [日常开发工作流](docs/DEVELOPMENT_WORKFLOW.md) 与 [工具参考](docs/TOOLS.md)。
|
|
277
|
+
所有机器工具均通过 `projectId` 指定项目(当多台已授权设备同时在线时还须指定 `deviceId`)。进程采用由启动客户端主体和项目共同拥有的任务 UUID(不接受任意系统 PID),并通过 Linux 进程组或 Windows Job Object 管理子孙进程。详见 [日常开发工作流](docs/DEVELOPMENT_WORKFLOW.zh-CN.md) 与 [工具参考](docs/TOOLS.zh-CN.md)。
|
|
277
278
|
|
|
278
279
|
### 双层 Web 权限管理
|
|
279
280
|
|
|
@@ -301,16 +302,16 @@ licenses/ # 锁定的生产依赖许可证文本
|
|
|
301
302
|
|
|
302
303
|
| 文档 | 说明 |
|
|
303
304
|
| --- | --- |
|
|
304
|
-
| [文档索引](docs/README.md) | 全部使用、运维、安全与设计文档总览 |
|
|
305
|
-
| [部署与运维](docs/DEPLOYMENT.md) | Docker Compose、Caddy、Nginx、Cloudflare Tunnel、配对、自启动与备份恢复 |
|
|
306
|
-
| [AI 客户端连接](docs/CLIENTS.md) | Claude、ChatGPT、Cursor 及 MCP SDK 接入指南 |
|
|
307
|
-
| [日常开发工作流](docs/DEVELOPMENT_WORKFLOW.md) | 命令别名与环境配置、按行读取、多文件原子编辑、恢复日志与工作流边界 |
|
|
308
|
-
| [远程协助指南](docs/REMOTE_ASSIST.md) | 一次性邀请、多项目本机审批、独立到期与安全边界 |
|
|
309
|
-
| [工具与配置参考](docs/TOOLS.md) | 工具参数、Scope、分页限额与管理端 API |
|
|
310
|
-
| [架构与技术选型](docs/ARCHITECTURE.md) | 模块划分、信任边界、消息协议、持久化与并发控制 |
|
|
305
|
+
| [文档索引](docs/README.zh-CN.md) | 全部使用、运维、安全与设计文档总览 |
|
|
306
|
+
| [部署与运维](docs/DEPLOYMENT.zh-CN.md) | Docker Compose、Caddy、Nginx、Cloudflare Tunnel、配对、自启动与备份恢复 |
|
|
307
|
+
| [AI 客户端连接](docs/CLIENTS.zh-CN.md) | Claude、ChatGPT、Cursor 及 MCP SDK 接入指南 |
|
|
308
|
+
| [日常开发工作流](docs/DEVELOPMENT_WORKFLOW.zh-CN.md) | 命令别名与环境配置、按行读取、多文件原子编辑、恢复日志与工作流边界 |
|
|
309
|
+
| [远程协助指南](docs/REMOTE_ASSIST.zh-CN.md) | 一次性邀请、多项目本机审批、独立到期与安全边界 |
|
|
310
|
+
| [工具与配置参考](docs/TOOLS.zh-CN.md) | 工具参数、Scope、分页限额与管理端 API |
|
|
311
|
+
| [架构与技术选型](docs/ARCHITECTURE.zh-CN.md) | 模块划分、信任边界、消息协议、持久化与并发控制 |
|
|
311
312
|
| [安全模型](SECURITY.md) | 命令执行的真实权限边界、默认限制与漏洞报告方式 |
|
|
312
|
-
| [验证记录](docs/VALIDATION.md) | 已执行的自动化验证与环境验收范围 |
|
|
313
|
-
| [参考项目对比](docs/COMPARISON.md) 与 [源码审计](docs/WEBCODEX_CODE_AUDIT.md) | 与参考项目的架构对比及 29 个工具域逐项映射 |
|
|
313
|
+
| [验证记录](docs/VALIDATION.zh-CN.md) | 已执行的自动化验证与环境验收范围 |
|
|
314
|
+
| [参考项目对比](docs/COMPARISON.zh-CN.md) 与 [源码审计](docs/WEBCODEX_CODE_AUDIT.zh-CN.md) | 与参考项目的架构对比及 29 个工具域逐项映射 |
|
|
314
315
|
|
|
315
316
|
## 源码开发与验证
|
|
316
317
|
|
|
@@ -333,7 +334,7 @@ npm run notices:check
|
|
|
333
334
|
npm audit --omit=dev --audit-level=high
|
|
334
335
|
```
|
|
335
336
|
|
|
336
|
-
开发规范详见 [CONTRIBUTING.md](CONTRIBUTING.md),源码归档与双包 npm 发布检查详见 [开源与发布检查](docs/OPEN_SOURCE.md)。
|
|
337
|
+
开发规范详见 [CONTRIBUTING.md](CONTRIBUTING.md),源码归档与双包 npm 发布检查详见 [开源与发布检查](docs/OPEN_SOURCE.zh-CN.md)。
|
|
337
338
|
|
|
338
339
|
## 安全说明与许可证
|
|
339
340
|
|
package/dist/runner/context.js
CHANGED
|
@@ -9,11 +9,13 @@ export class Context {
|
|
|
9
9
|
files;
|
|
10
10
|
git;
|
|
11
11
|
processes;
|
|
12
|
-
|
|
12
|
+
memory;
|
|
13
|
+
constructor(config, files, git, processes, memory) {
|
|
13
14
|
this.config = config;
|
|
14
15
|
this.files = files;
|
|
15
16
|
this.git = git;
|
|
16
17
|
this.processes = processes;
|
|
18
|
+
this.memory = memory;
|
|
17
19
|
}
|
|
18
20
|
noteFile(project, owner) { return path.join(this.config.stateDir, 'notes', `${sha256(JSON.stringify([project.root, project.id, owner]))}.json`); }
|
|
19
21
|
async executableAvailable(executable) {
|
|
@@ -59,6 +61,14 @@ export class Context {
|
|
|
59
61
|
}
|
|
60
62
|
catch { }
|
|
61
63
|
}
|
|
64
|
+
if (includeInstructions && this.memory) {
|
|
65
|
+
try {
|
|
66
|
+
const charter = await this.memory.charter(project.id);
|
|
67
|
+
if (charter)
|
|
68
|
+
instructions.push({ path: 'memory/charter.md', text: charter.text, truncated: charter.truncated, trust: 'project_guidance_only' });
|
|
69
|
+
}
|
|
70
|
+
catch { /* Memory is advisory; failures never block context retrieval. */ }
|
|
71
|
+
}
|
|
62
72
|
let git;
|
|
63
73
|
try {
|
|
64
74
|
git = await this.git.invoke(project, 'git_branches', {}, signal);
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
import { accessSync, constants } from 'node:fs';
|
|
2
|
+
import { lstat, open, realpath } from 'node:fs/promises';
|
|
3
|
+
import { StringDecoder } from 'node:string_decoder';
|
|
4
|
+
import path from 'node:path';
|
|
5
|
+
import os from 'node:os';
|
|
6
|
+
import { inside } from './config.js';
|
|
7
|
+
const MAX_CHARTER_BYTES = 8192;
|
|
8
|
+
const MAX_HINT_BYTES = 4096;
|
|
9
|
+
const MAX_HINTS = 3;
|
|
10
|
+
const SEVERITY_ORDER = { critical: 0, warning: 1, info: 2 };
|
|
11
|
+
export function resolveWorkspacePath(configDir) {
|
|
12
|
+
if (process.env.HOMEAGENT_WORKSPACE)
|
|
13
|
+
return path.resolve(process.env.HOMEAGENT_WORKSPACE);
|
|
14
|
+
if (configDir) {
|
|
15
|
+
const candidate = path.join(configDir, 'workspace.json');
|
|
16
|
+
try {
|
|
17
|
+
accessSync(candidate);
|
|
18
|
+
return configDir;
|
|
19
|
+
}
|
|
20
|
+
catch { }
|
|
21
|
+
}
|
|
22
|
+
return path.join(os.homedir(), '.homeagent', 'workspace');
|
|
23
|
+
}
|
|
24
|
+
function safeFilename(value) {
|
|
25
|
+
return !!value && value !== '.' && value !== '..' && !/[<>:"/\\|?*\x00-\x1f]/.test(value)
|
|
26
|
+
&& !/[. ]$/.test(value) && !/^(con|prn|aux|nul|com[1-9]|lpt[1-9])(?:\.|$)/i.test(value);
|
|
27
|
+
}
|
|
28
|
+
// Streaming decoding leaves an incomplete final UTF-8 sequence buffered rather than emitting U+FFFD.
|
|
29
|
+
const utf8Prefix = (buffer, limit) => buffer.length > limit
|
|
30
|
+
? new StringDecoder('utf8').write(buffer.subarray(0, limit)) : buffer.toString('utf8');
|
|
31
|
+
export class Memory {
|
|
32
|
+
workspacePath;
|
|
33
|
+
indexCache = new Map();
|
|
34
|
+
constructor(workspacePath) {
|
|
35
|
+
this.workspacePath = workspacePath;
|
|
36
|
+
}
|
|
37
|
+
memoryDir(projectId) {
|
|
38
|
+
if (!/^[a-zA-Z0-9_-]{1,64}$/.test(projectId) || !safeFilename(projectId))
|
|
39
|
+
throw new Error('Invalid memory project ID');
|
|
40
|
+
return path.join(this.workspacePath, 'memory', projectId);
|
|
41
|
+
}
|
|
42
|
+
/** The configured workspace is trusted; no link underneath it may redirect memory reads. */
|
|
43
|
+
async checkedPath(projectId, parts) {
|
|
44
|
+
this.memoryDir(projectId); // Validate before constructing any filesystem path.
|
|
45
|
+
if (!parts.every(safeFilename))
|
|
46
|
+
throw new Error('Invalid memory filename');
|
|
47
|
+
const root = await realpath(this.workspacePath);
|
|
48
|
+
let current = root;
|
|
49
|
+
const components = ['memory', projectId, ...parts];
|
|
50
|
+
for (const [index, part] of components.entries()) {
|
|
51
|
+
current = path.join(current, part);
|
|
52
|
+
if (!inside(root, current))
|
|
53
|
+
throw new Error('Memory path escape');
|
|
54
|
+
const entry = await lstat(current);
|
|
55
|
+
if (entry.isSymbolicLink() || (index < components.length - 1 ? !entry.isDirectory() : !entry.isFile() || entry.nlink !== 1))
|
|
56
|
+
throw new Error('Unsafe memory file');
|
|
57
|
+
if (!inside(root, await realpath(current)))
|
|
58
|
+
throw new Error('Resolved memory path escape');
|
|
59
|
+
}
|
|
60
|
+
return current;
|
|
61
|
+
}
|
|
62
|
+
async readMemoryFile(projectId, parts, limit) {
|
|
63
|
+
const filename = await this.checkedPath(projectId, parts);
|
|
64
|
+
const handle = await open(filename, constants.O_RDONLY | (constants.O_NOFOLLOW ?? 0));
|
|
65
|
+
try {
|
|
66
|
+
const opened = await handle.stat();
|
|
67
|
+
if (!opened.isFile() || opened.nlink !== 1)
|
|
68
|
+
throw new Error('Unsafe memory file');
|
|
69
|
+
const checked = await lstat(await this.checkedPath(projectId, parts));
|
|
70
|
+
if (opened.dev !== checked.dev || opened.ino !== checked.ino)
|
|
71
|
+
throw new Error('Memory file changed');
|
|
72
|
+
const buffer = Buffer.alloc(limit + 1);
|
|
73
|
+
let size = 0;
|
|
74
|
+
while (size < buffer.length) {
|
|
75
|
+
const { bytesRead } = await handle.read(buffer, size, buffer.length - size, size);
|
|
76
|
+
if (!bytesRead)
|
|
77
|
+
break;
|
|
78
|
+
size += bytesRead;
|
|
79
|
+
}
|
|
80
|
+
return buffer.subarray(0, size);
|
|
81
|
+
}
|
|
82
|
+
finally {
|
|
83
|
+
await handle.close();
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
async charter(projectId) {
|
|
87
|
+
try {
|
|
88
|
+
const buffer = await this.readMemoryFile(projectId, ['charter.md'], MAX_CHARTER_BYTES);
|
|
89
|
+
const truncated = buffer.byteLength > MAX_CHARTER_BYTES;
|
|
90
|
+
const text = utf8Prefix(buffer, MAX_CHARTER_BYTES);
|
|
91
|
+
return text ? { text, truncated } : null;
|
|
92
|
+
}
|
|
93
|
+
catch {
|
|
94
|
+
return null;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
async loadIndex(projectId) {
|
|
98
|
+
try {
|
|
99
|
+
const filename = await this.checkedPath(projectId, ['pitfalls', '_index.json']);
|
|
100
|
+
const s = await lstat(filename);
|
|
101
|
+
const cached = this.indexCache.get(projectId);
|
|
102
|
+
if (cached && cached.mtimeMs === s.mtimeMs)
|
|
103
|
+
return cached.entries;
|
|
104
|
+
const buffer = await this.readMemoryFile(projectId, ['pitfalls', '_index.json'], 262144);
|
|
105
|
+
if (buffer.length > 262144)
|
|
106
|
+
return {};
|
|
107
|
+
const raw = JSON.parse(buffer.toString('utf8'));
|
|
108
|
+
if (!raw || typeof raw !== 'object' || Array.isArray(raw))
|
|
109
|
+
return {};
|
|
110
|
+
const entries = Object.create(null);
|
|
111
|
+
for (const [file, value] of Object.entries(raw)) {
|
|
112
|
+
if (!safeFilename(file) || !value || typeof value !== 'object' || Array.isArray(value))
|
|
113
|
+
continue;
|
|
114
|
+
const v = value;
|
|
115
|
+
if (!Array.isArray(v.globs) || !v.globs.every(g => typeof g === 'string'))
|
|
116
|
+
continue;
|
|
117
|
+
entries[file] = {
|
|
118
|
+
globs: v.globs,
|
|
119
|
+
severity: (['critical', 'warning', 'info'].includes(v.severity) ? v.severity : 'info'),
|
|
120
|
+
source: typeof v.source === 'string' ? v.source : '',
|
|
121
|
+
created: typeof v.created === 'string' ? v.created : undefined,
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
this.indexCache.set(projectId, { mtimeMs: s.mtimeMs, entries });
|
|
125
|
+
return entries;
|
|
126
|
+
}
|
|
127
|
+
catch {
|
|
128
|
+
return {};
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
async match(projectId, paths) {
|
|
132
|
+
if (!paths.length)
|
|
133
|
+
return [];
|
|
134
|
+
const index = await this.loadIndex(projectId);
|
|
135
|
+
const normalized = paths.map(p => path.posix.normalize(p.replaceAll('\\', '/')).replace(/^\.\//, ''));
|
|
136
|
+
const hits = [];
|
|
137
|
+
for (const [file, entry] of Object.entries(index)) {
|
|
138
|
+
const matched = normalized.filter(p => entry.globs.some(g => path.posix.matchesGlob(p, g)));
|
|
139
|
+
if (matched.length)
|
|
140
|
+
hits.push({ file, entry, matchedPaths: matched });
|
|
141
|
+
}
|
|
142
|
+
hits.sort((a, b) => (SEVERITY_ORDER[a.entry.severity] ?? 2) - (SEVERITY_ORDER[b.entry.severity] ?? 2));
|
|
143
|
+
const results = [];
|
|
144
|
+
let totalBytes = 0;
|
|
145
|
+
for (const hit of hits) {
|
|
146
|
+
if (results.length >= MAX_HINTS)
|
|
147
|
+
break;
|
|
148
|
+
try {
|
|
149
|
+
const remaining = MAX_HINT_BYTES - totalBytes;
|
|
150
|
+
if (remaining <= 0)
|
|
151
|
+
break;
|
|
152
|
+
const buffer = await this.readMemoryFile(projectId, ['pitfalls', hit.file], remaining);
|
|
153
|
+
const content = utf8Prefix(buffer, remaining);
|
|
154
|
+
totalBytes += Buffer.byteLength(content);
|
|
155
|
+
const prefix = hit.entry.severity === 'critical' ? '⚠️' : '💡';
|
|
156
|
+
results.push({
|
|
157
|
+
file: hit.file,
|
|
158
|
+
severity: hit.entry.severity,
|
|
159
|
+
source: hit.entry.source,
|
|
160
|
+
content: `${prefix} [${hit.entry.severity} · 来源: ${hit.entry.source}]\n${content}`,
|
|
161
|
+
matchedPaths: hit.matchedPaths,
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
catch { /* Missing memory file — skip silently. */ }
|
|
165
|
+
}
|
|
166
|
+
return results;
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
//# sourceMappingURL=memory.js.map
|
package/dist/runner/tools.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import path from 'node:path';
|
|
1
2
|
import { AppError, errorText, result } from '../shared/protocol.js';
|
|
2
3
|
import { toolSchemas, toolScope } from '../shared/tools.js';
|
|
3
4
|
import { Policy } from './policy.js';
|
|
@@ -9,6 +10,7 @@ import { Context } from './context.js';
|
|
|
9
10
|
import { parseUnifiedDiff } from './patch.js';
|
|
10
11
|
import { Shells } from './shells.js';
|
|
11
12
|
import { Lsp } from './lsp.js';
|
|
13
|
+
import { Memory, resolveWorkspacePath } from './memory.js';
|
|
12
14
|
/** Serialize each project's mutations so expected hashes and moves are meaningful across concurrent clients. */
|
|
13
15
|
export class Tools {
|
|
14
16
|
deviceId;
|
|
@@ -21,6 +23,7 @@ export class Tools {
|
|
|
21
23
|
context;
|
|
22
24
|
shells;
|
|
23
25
|
lsp;
|
|
26
|
+
memory;
|
|
24
27
|
locks = new Map();
|
|
25
28
|
constructor(config, deviceId, consent) {
|
|
26
29
|
this.deviceId = deviceId;
|
|
@@ -30,7 +33,9 @@ export class Tools {
|
|
|
30
33
|
this.processes = new Processes(config, this.policy);
|
|
31
34
|
this.git = new Git(this.policy);
|
|
32
35
|
this.editor = new Editor(config, this.files);
|
|
33
|
-
|
|
36
|
+
const configDir = config.stateDir ? path.dirname(config.stateDir) : undefined;
|
|
37
|
+
this.memory = new Memory(resolveWorkspacePath(configDir));
|
|
38
|
+
this.context = new Context(config, this.files, this.git, this.processes, this.memory);
|
|
34
39
|
this.shells = new Shells(this.policy, this.processes);
|
|
35
40
|
this.lsp = new Lsp(this.policy, this.files, this.git);
|
|
36
41
|
}
|
|
@@ -64,21 +69,40 @@ export class Tools {
|
|
|
64
69
|
switch (tool) {
|
|
65
70
|
case 'get_project_context': return { ...await this.context.get(project, principal.id, toolSchemas.get_project_context.parse(args).includeInstructions, signal), grantedScopes: principal.scopes, executionPolicy, filesystemPolicy };
|
|
66
71
|
case 'save_project_note': return this.context.note(project, principal.id, toolSchemas.save_project_note.parse(args).text);
|
|
67
|
-
case 'read_files':
|
|
72
|
+
case 'read_files': {
|
|
73
|
+
const input = toolSchemas.read_files.parse(args);
|
|
74
|
+
const output = await this.files.readFiles(project, input);
|
|
75
|
+
const hints = await this.memory.match(project.id, input.files.map(f => f.path)).catch(() => []);
|
|
76
|
+
return hints.length ? { ...output, memoryHints: hints } : output;
|
|
77
|
+
}
|
|
68
78
|
case 'edit_files': {
|
|
69
79
|
const input = toolSchemas.edit_files.parse(args);
|
|
70
|
-
|
|
80
|
+
const output = await this.editor.edit(project, principal.id, input.changes, input.dryRun, signal);
|
|
81
|
+
const hints = await this.memory.match(project.id, input.changes.map(c => c.path)).catch(() => []);
|
|
82
|
+
return hints.length ? { ...output, memoryHints: hints } : output;
|
|
71
83
|
}
|
|
72
84
|
case 'apply_unified_diff': {
|
|
73
85
|
const input = toolSchemas.apply_unified_diff.parse(args);
|
|
74
86
|
const parsed = await parseUnifiedDiff(this.files, project, input.diff, input.expectedSha256, { fuzz: input.fuzz, ignoreWhitespace: input.ignoreWhitespace });
|
|
75
|
-
|
|
87
|
+
const output = { ...await this.editor.edit(project, principal.id, parsed, input.dryRun, signal), relocatedHunks: parsed.relocatedHunks };
|
|
88
|
+
const hints = await this.memory.match(project.id, Object.keys(input.expectedSha256)).catch(() => []);
|
|
89
|
+
return hints.length ? { ...output, memoryHints: hints } : output;
|
|
76
90
|
}
|
|
77
91
|
case 'get_edit_transactions': return this.editor.list(project, principal.id);
|
|
78
92
|
case 'recover_edit_transaction': return this.editor.recover(project, principal.id, toolSchemas.recover_edit_transaction.parse(args).transactionId);
|
|
79
93
|
case 'list_directory': return this.files.list(project, toolSchemas.list_directory.parse(args));
|
|
80
|
-
case 'read_file':
|
|
81
|
-
|
|
94
|
+
case 'read_file': {
|
|
95
|
+
const input = toolSchemas.read_file.parse(args);
|
|
96
|
+
const output = await this.files.read(project, input);
|
|
97
|
+
const hints = await this.memory.match(project.id, [input.path]).catch(() => []);
|
|
98
|
+
return hints.length ? { ...output, memoryHints: hints } : output;
|
|
99
|
+
}
|
|
100
|
+
case 'write_file': {
|
|
101
|
+
const input = toolSchemas.write_file.parse(args);
|
|
102
|
+
const output = await this.files.write(project, input);
|
|
103
|
+
const hints = await this.memory.match(project.id, [input.path]).catch(() => []);
|
|
104
|
+
return hints.length ? { ...output, memoryHints: hints } : output;
|
|
105
|
+
}
|
|
82
106
|
case 'create_directory': return this.files.mkdir(project, toolSchemas.create_directory.parse(args).path);
|
|
83
107
|
case 'move_file': {
|
|
84
108
|
const a = toolSchemas.move_file.parse(args);
|
|
@@ -98,7 +122,12 @@ export class Tools {
|
|
|
98
122
|
}
|
|
99
123
|
return this.files.search(project, input, signal, source);
|
|
100
124
|
}
|
|
101
|
-
case 'edit_block':
|
|
125
|
+
case 'edit_block': {
|
|
126
|
+
const input = toolSchemas.edit_block.parse(args);
|
|
127
|
+
const output = await this.files.edit(project, input);
|
|
128
|
+
const hints = await this.memory.match(project.id, [input.path]).catch(() => []);
|
|
129
|
+
return hints.length ? { ...output, memoryHints: hints } : output;
|
|
130
|
+
}
|
|
102
131
|
case 'get_file_info': return this.files.info(project, toolSchemas.get_file_info.parse(args).path);
|
|
103
132
|
case 'start_process': return this.processes.start(project, principal.id, toolSchemas.start_process.parse(args), signal, executionAuthorization);
|
|
104
133
|
case 'run_command': return this.processes.run(project, principal.id, toolSchemas.run_command.parse(args), signal, executionAuthorization);
|
package/dist/shared/protocol.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { remotePermissionsSchema } from './permissions.js';
|
|
3
3
|
import { assistContextSchema, assistDescriptorSchema, assistMultiDescriptorSchema, assistCleanupSchema, ASSIST_FEATURE, ASSIST_MULTI_FEATURE } from './assist.js';
|
|
4
|
-
export const VERSION = '0.4.
|
|
4
|
+
export const VERSION = '0.4.20';
|
|
5
5
|
export const RUNNER_PROTOCOL = 2;
|
|
6
6
|
export const MAX_FRAME = 2 * 1024 * 1024;
|
|
7
7
|
export const SCOPES = ['read', 'write', 'execute', 'git'];
|
package/dist/shared/tools.js
CHANGED
|
@@ -63,6 +63,12 @@ const schemas = {
|
|
|
63
63
|
git_fetch: z.object({ ...gitTarget, remote: z.string().min(1).max(128).default('origin'), branch: z.string().min(1).max(200).optional() }).strict(),
|
|
64
64
|
git_pull: z.object({ ...gitTarget, remote: z.string().min(1).max(128).default('origin'), branch: z.string().min(1).max(200).optional() }).strict(),
|
|
65
65
|
git_push: z.object({ ...gitTarget, remote: z.string().min(1).max(128).default('origin'), branch: z.string().min(1).max(200).optional() }).strict(),
|
|
66
|
+
kanban_list_tasks: z.object({ ...target, status: z.enum(['todo', 'in_progress', 'review', 'done']).optional() }).strict(),
|
|
67
|
+
kanban_create_task: z.object({ ...target, title: z.string().min(1).max(256), description: z.string().max(4096).default(''), targetPaths: z.array(z.string().max(512)).max(32).default([]), requiresReview: z.boolean().default(true) }).strict(),
|
|
68
|
+
kanban_claim_task: z.object({ ...target, taskId: z.string().min(1).max(32) }).strict(),
|
|
69
|
+
kanban_update_task: z.object({ ...target, taskId: z.string().min(1).max(32), actualPaths: z.array(z.string().max(512)).max(64).optional(), message: z.string().max(1024).optional() }).strict(),
|
|
70
|
+
kanban_submit_review: z.object({ ...target, taskId: z.string().min(1).max(32), proposedCommitMessage: z.string().min(1).max(512), aiSummary: z.string().max(2048).default(''), fileHashes: z.record(z.string(), z.string().regex(/^[a-f0-9]{64}$/)).default({}) }).strict(),
|
|
71
|
+
kanban_complete_task: z.object({ ...target, taskId: z.string().min(1).max(32), skipReview: z.boolean().default(false) }).strict(),
|
|
66
72
|
};
|
|
67
73
|
export const toolSchemas = schemas;
|
|
68
74
|
const descriptions = {
|
|
@@ -110,9 +116,15 @@ const descriptions = {
|
|
|
110
116
|
git_fetch: 'Fetch a named configured HTTPS/SSH remote without submodules. Requires owner-enabled Git writes and network access. Use repository to select a nested repository.',
|
|
111
117
|
git_pull: 'Fast-forward a clean repository from a named configured HTTPS/SSH remote; never rebase, merge divergent history or recurse into submodules. Requires Git network access.',
|
|
112
118
|
git_push: 'Push HEAD to one branch on a named configured HTTPS/SSH remote, without force, deletion or tags. Requires the owner to separately enable Git push.',
|
|
119
|
+
kanban_list_tasks: 'List project Kanban tasks, optionally filtered by status.',
|
|
120
|
+
kanban_create_task: 'Create a Kanban task with title, description, expected file paths and review requirement.',
|
|
121
|
+
kanban_claim_task: 'Claim a todo task, acquiring a 30-minute renewable lease. Returns conflict warnings if paths overlap with in-progress work.',
|
|
122
|
+
kanban_update_task: 'Update task progress: report actual modified paths or leave a message.',
|
|
123
|
+
kanban_submit_review: 'Submit completed work for review with a proposed commit message, AI summary, and file hashes for fingerprint protection.',
|
|
124
|
+
kanban_complete_task: 'Mark a task as done. Use skipReview to bypass the review stage.',
|
|
113
125
|
};
|
|
114
126
|
export function toolScope(name) {
|
|
115
|
-
if (['write_file', 'create_directory', 'move_file', 'edit_block', 'edit_files', 'apply_unified_diff', 'recover_edit_transaction', 'save_project_note'].includes(name))
|
|
127
|
+
if (['write_file', 'create_directory', 'move_file', 'edit_block', 'edit_files', 'apply_unified_diff', 'recover_edit_transaction', 'save_project_note', 'kanban_create_task', 'kanban_claim_task', 'kanban_update_task', 'kanban_submit_review', 'kanban_complete_task'].includes(name))
|
|
116
128
|
return 'write';
|
|
117
129
|
if (['start_process', 'run_command', 'write_process_input', 'stop_process', 'start_shell', 'run_shell', 'stop_shell'].includes(name))
|
|
118
130
|
return 'execute';
|