homeagent-runner 0.4.20 → 0.5.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/CHANGELOG.md CHANGED
@@ -1,5 +1,39 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.5.0 — Agent dispatch and calendar integration
4
+
5
+ - Add Agent roles, directory-free PAT/OAuth authorizations and task/calendar scopes,
6
+ with live MCP catalog filtering and explicit machine-call rejection for cloud agents.
7
+ - Add nine unified dispatch tools, exact workspace assignment checks, revision-fenced
8
+ ownership, blocked tasks, priorities, risk gates and validated test-job evidence.
9
+ Preserve protocol-v2 Runners, the tasks KV bucket, leases and advisory path staleness.
10
+ Keep task/calendar scopes on the Server when relaying calls to older protocol-v2 Runners.
11
+ - Extend the Web board to five columns with Agent perspectives, directory-aware
12
+ assignment, risk/deadline badges and selected 30-minute unblock permissions.
13
+ - Add optional Google/CalDAV busy/deadline caches and isolated task-calendar writeback,
14
+ disabled by default, with no new dependencies. See [Agent dispatch](docs/AGENT_DISPATCH.md).
15
+ - Cover cloud credentials, role/scope enforcement, compatibility aliases, review gates,
16
+ OAuth rotation, calendar failures and a real protocol-v2 Runner dispatch workflow.
17
+
18
+ ## 0.4.21 — Web project Kanban and validated drag-and-drop
19
+
20
+ - Add a Project Kanban console view with four status columns, a list view, project,
21
+ device and client filters, file-path search, paginated history and mobile layouts.
22
+ Create and edit tasks, add comments, and inspect delivery evidence and activity in
23
+ a task detail drawer without leaving the board.
24
+ - Support dragging cards between valid states, with equivalent keyboard/mobile
25
+ controls. Assignment checks current client/device/project grants; submission,
26
+ approval, skipped review, release, rejection and reopening require the appropriate
27
+ input or confirmation. These actions do not run commands, wake AI clients or commit Git.
28
+ - Protect administrator task mutations with session/CSRF checks, audited actions,
29
+ explicit state transitions and optimistic task revisions. Preserve drafts on
30
+ concurrent updates and keep browser polling/comments from renewing worker leases.
31
+ - Track advisory review staleness after confirmed built-in file mutations, expose
32
+ bounded evidence/history totals, and distinguish client-reported evidence from
33
+ independent verification. Preserve loaded history and form focus during refreshes.
34
+ - Add API, authorization, pagination, transition and UI-model regressions; document
35
+ the Web workflow in English and Simplified Chinese.
36
+
3
37
  ## 0.4.20 — Project memory and authorized Kanban coordination
4
38
 
5
39
  - Add six server-side Kanban tools for task creation, claiming, progress updates,
package/README.md CHANGED
@@ -42,7 +42,7 @@ Lightweight **Runners** connect outbound over authenticated WebSockets (`WSS`) t
42
42
 
43
43
  | Your Infrastructure, Your Control | Built for Real-World Development |
44
44
  | --- | --- |
45
- | **Self-Hosted Control Plane**: Run the Server, embedded SQLite database, and audit trail on your own VPS or local network. | **45 Built-In MCP Tools**: Project discovery, batch line-range reads, fuzzy unified diffs, journaled multi-file edits, persistent shell sessions, and LSP navigation/diagnostics. |
45
+ | **Self-Hosted Control Plane**: Run the Server, embedded SQLite database, and audit trail on your own VPS or local network. | **60 Registered MCP Tools**: Project discovery, batch line-range reads, fuzzy unified diffs, journaled multi-file edits, persistent shell sessions, and LSP navigation/diagnostics. |
46
46
  | **Outbound-Only Runners**: Connect Linux and Windows machines over authenticated `WSS` without port forwarding or inbound exposure. | **Observable Process Jobs**: Short commands return inline; long tasks support waiting, rolling output tails, standard input, and process-tree termination. |
47
47
  | **Two-Layer Permissions**: Combine per-device capability limits with per-client OAuth / token scopes, plus temporary minute-level elevation. | **Safe Git Workflows**: Inspect status and diffs, commit explicit file paths without disturbing unrelated staged changes, and gate `fetch` / `pull` / `push` separately. |
48
48
 
@@ -60,7 +60,7 @@ flowchart TB
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
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.
63
+ - **Release Scope**: Current release **v0.5.0** 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.20 --depth 1 https://github.com/jhxxr/HomeAgent.git
119
+ git clone --branch v0.5.0 --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
@@ -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.20`). Check versions anytime with `homeagent-server --version`, `homeagent --version`, or in the Dashboard header.
192
+ - **Version Alignment**: Prefer `homeagent-server` and `homeagent-runner` on the same release (`v0.5.0`). Existing v0.4.21 protocol-v2 Runners remain compatible with the v0.5.0 server-side Agent scheduling changes. 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
- ### 51 Built-In Tools
266
+ ### Up to 60 Registered Tools
267
267
 
268
268
  | Category | Tools |
269
269
  | --- | --- |
@@ -271,9 +271,12 @@ 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
+ | **Agent Dispatch** | `task_inbox`, `task_claim`, `task_update`, `task_block`, `task_submit`, `agent_directory`, `task_dispatch`, `task_review`, `calendar_context` |
275
+ | **Legacy Kanban (deprecated)** | `kanban_list_tasks`, `kanban_create_task`, `kanban_claim_task`, `kanban_update_task`, `kanban_submit_review`, `kanban_complete_task` |
275
276
  | **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` |
276
277
 
278
+ The catalog is filtered by Agent role, scopes, workspace binding and tool grants. Start with zero-argument `task_inbox()`; directory-free cloud supervisors need no paired device. See [Agent dispatch and calendar integration](docs/AGENT_DISPATCH.md).
279
+
277
280
  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).
278
281
 
279
282
  ### Two-Layer Web Permissions
package/README.zh-CN.md CHANGED
@@ -60,7 +60,7 @@ flowchart TB
60
60
 
61
61
  - **协议兼容**:基于 MCP 官方 SDK v2 实现 Streamable HTTP(`/mcp`),同时支持 `2026-07-28` 发现与信封规范及 `2025` 协议兼容。
62
62
  - **认证体系**:控制台支持管理员密码与 [XAuth](https://github.com/jhxxr/XAuth) OIDC 登录(首个登录的 XAuth 账号自动绑定为唯一管理员);客户端支持带 `S256` PKCE 的 OAuth 2.1 授权码流程、按范围受限的 Bearer 令牌(PAT),以及浏览器/配对码一次性设备绑定。
63
- - **版本边界**:当前版本 **v0.4.20** 支持单管理员、多设备与多项目。持久交互式 PTY 终端、跨 Runner 重启保留脱离进程、自动 worktree 注册及预览隧道不在当前实现范围内。
63
+ - **版本边界**:当前版本 **v0.5.0** 支持单管理员、多设备与多项目。持久交互式 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.20 --depth 1 https://github.com/jhxxr/HomeAgent.git
119
+ git clone --branch v0.5.0 --depth 1 https://github.com/jhxxr/HomeAgent.git
120
120
  cd HomeAgent
121
121
 
122
122
  # 使用容器生成随机密码和会话密钥,无需在宿主机安装 Node.js
@@ -189,7 +189,7 @@ 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.20`),可通过 `homeagent-server --version`、`homeagent --version` 或控制台顶部查看。
192
+ - **版本一致性**:建议 `homeagent-server` 与 `homeagent-runner` 使用同一版本(`v0.5.0`);现有 v0.4.21 协议 v2 Runner 仍兼容 v0.5.0 的 Server 端 Agent 调度改造。可通过 `homeagent-server --version`、`homeagent --version` 或控制台顶部查看。
193
193
  - **客户端配置详情**:各客户端完整接入步骤见 [AI 客户端连接指南](docs/CLIENTS.zh-CN.md)。
194
194
 
195
195
  ## AI 远程开发教程与提示词模板
@@ -263,7 +263,7 @@ homeagent
263
263
 
264
264
  ## MCP 工具
265
265
 
266
- ### 51 个已实现工具
266
+ ### 最多 60 个注册工具
267
267
 
268
268
  | 类别 | 工具列表 |
269
269
  | --- | --- |
@@ -271,9 +271,12 @@ 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
+ | **Agent 调度** | `task_inbox`, `task_claim`, `task_update`, `task_block`, `task_submit`, `agent_directory`, `task_dispatch`, `task_review`, `calendar_context` |
275
+ | **旧看板兼容(deprecated)** | `kanban_list_tasks`, `kanban_create_task`, `kanban_claim_task`, `kanban_update_task`, `kanban_submit_review`, `kanban_complete_task` |
275
276
  | **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` |
276
277
 
278
+ 工具目录按角色、scope、目录绑定和工具授权动态裁剪。所有 Agent 从零参 `task_inbox()` 开始;无目录云端主管无需配对设备。详见 [Agent 调度与日历联动](docs/AGENT_DISPATCH.zh-CN.md)。
279
+
277
280
  所有机器工具均通过 `projectId` 指定项目(当多台已授权设备同时在线时还须指定 `deviceId`)。进程采用由启动客户端主体和项目共同拥有的任务 UUID(不接受任意系统 PID),并通过 Linux 进程组或 Windows Job Object 管理子孙进程。详见 [日常开发工作流](docs/DEVELOPMENT_WORKFLOW.zh-CN.md) 与 [工具参考](docs/TOOLS.zh-CN.md)。
278
281
 
279
282
  ### 双层 Web 权限管理
@@ -0,0 +1,6 @@
1
+ export const MACHINE_SCOPES = ['read', 'write', 'execute', 'git'];
2
+ export const TASK_SCOPES = ['tasks:self', 'tasks:dispatch', 'tasks:review', 'calendar:read'];
3
+ export const SCOPES = [...MACHINE_SCOPES, ...TASK_SCOPES];
4
+ export const AGENT_ROLES = ['worker', 'supervisor', 'observer'];
5
+ export const BINDING_MODES = ['bound_projects', 'none'];
6
+ //# sourceMappingURL=agent.js.map
@@ -1,4 +1,5 @@
1
1
  import { z } from 'zod';
2
+ import { SCOPES, AGENT_ROLES, BINDING_MODES } from './agent.js';
2
3
  export const commandAliasesSchema = z.record(z.string().regex(/^[a-zA-Z0-9_-]{1,64}$/), z.object({
3
4
  executable: z.string().min(1).max(4096), args: z.array(z.string().max(8192)).max(256).default([]),
4
5
  }).strict()).refine(value => Object.keys(value).length <= 64, 'At most 64 command aliases per project').default({});
@@ -29,12 +30,17 @@ export const remotePermissionsSchema = z.object({
29
30
  fallbackProjects: z.array(permissionProjectSchema).max(100),
30
31
  }).strict();
31
32
  export const grantPermissionsSchema = z.object({
32
- scopes: z.array(z.enum(['read', 'write', 'execute', 'git'])).max(4),
33
+ scopes: z.array(z.enum(SCOPES)).max(8),
34
+ agentRole: z.enum(AGENT_ROLES).optional(),
35
+ bindingMode: z.enum(BINDING_MODES).optional(),
36
+ displayName: z.string().trim().min(1).max(128).optional(),
33
37
  devices: z.array(z.string().uuid()).max(100),
34
38
  projectGrants: z.record(z.string().uuid(), z.array(z.string().min(1).max(64)).max(100)),
35
39
  tools: z.array(z.string().min(1).max(64)).max(100).nullable().default(null),
36
40
  machineAccess: z.boolean().default(false),
37
41
  unrestrictedExecution: z.boolean().default(false),
38
- }).strict();
42
+ }).strict().refine(value => value.bindingMode === 'none'
43
+ ? value.devices.length === 0 && Object.keys(value.projectGrants).length === 0
44
+ : true, 'Unbound agents must have empty devices and projectGrants');
39
45
  export const permissionDuration = z.number().int().min(1).max(10080).nullable();
40
46
  //# sourceMappingURL=permissions.js.map
@@ -1,12 +1,16 @@
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.20';
4
+ import { SCOPES, AGENT_ROLES, BINDING_MODES } from './agent.js';
5
+ export { SCOPES, MACHINE_SCOPES, TASK_SCOPES, AGENT_ROLES, BINDING_MODES } from './agent.js';
6
+ export const VERSION = '0.5.0';
5
7
  export const RUNNER_PROTOCOL = 2;
6
8
  export const MAX_FRAME = 2 * 1024 * 1024;
7
- export const SCOPES = ['read', 'write', 'execute', 'git'];
8
9
  export const principalSchema = z.object({
9
10
  id: z.string().max(200),
11
+ agentRole: z.enum(AGENT_ROLES).optional(),
12
+ bindingMode: z.enum(BINDING_MODES).optional(),
13
+ displayName: z.string().trim().min(1).max(128).optional(),
10
14
  scopes: z.array(z.enum(SCOPES)),
11
15
  devices: z.array(z.string()).nullable(),
12
16
  projects: z.array(z.string()).nullable(),
@@ -20,8 +24,24 @@ export const principalSchema = z.object({
20
24
  credentialExpiresAt: z.number().int().positive().optional(),
21
25
  assist: assistContextSchema.optional(),
22
26
  });
27
+ /** Read-time defaults preserve old credentials without updating stored grants or expiry. */
28
+ export function normalizePrincipal(principal) {
29
+ const legacy = principal.agentRole === undefined && principal.bindingMode === undefined;
30
+ const scopes = legacy && principal.scopes.includes('write') && !principal.scopes.includes('tasks:self')
31
+ ? [...principal.scopes, 'tasks:self'] : principal.scopes;
32
+ return {
33
+ ...principal,
34
+ agentRole: principal.agentRole ?? 'worker',
35
+ bindingMode: principal.bindingMode ?? 'bound_projects',
36
+ displayName: principal.displayName ?? principal.id,
37
+ // Read tools can contain optional execution branches (for example external LSP).
38
+ // Strip effective mutation scopes before forwarding to an unchanged protocol-v2 Runner.
39
+ scopes: principal.agentRole === 'observer' ? scopes.filter(scope => scope === 'read' || scope === 'tasks:self') : scopes,
40
+ ...(principal.bindingMode === 'none' ? { devices: [], projects: [], projectGrants: {}, machineAccess: false, unrestrictedExecution: false } : {}),
41
+ };
42
+ }
23
43
  export function projectGranted(principal, deviceId, projectId) {
24
- return (!principal.devices || principal.devices.includes(deviceId))
44
+ return principal.bindingMode !== 'none' && (!principal.devices || principal.devices.includes(deviceId))
25
45
  && (!principal.projects || principal.projects.includes(projectId))
26
46
  && (!principal.projectGrants || !!principal.projectGrants[deviceId]?.includes(projectId));
27
47
  }
@@ -1,4 +1,5 @@
1
1
  import { z } from 'zod';
2
+ import { normalizePrincipal } from './protocol.js';
2
3
  const target = {
3
4
  deviceId: z.string().min(1).max(100).optional().describe('Required when more than one authorized device is online'),
4
5
  projectId: z.string().min(1).max(64).describe('Project ID from list_devices'),
@@ -63,7 +64,7 @@ const schemas = {
63
64
  git_fetch: z.object({ ...gitTarget, remote: z.string().min(1).max(128).default('origin'), branch: z.string().min(1).max(200).optional() }).strict(),
64
65
  git_pull: z.object({ ...gitTarget, remote: z.string().min(1).max(128).default('origin'), branch: z.string().min(1).max(200).optional() }).strict(),
65
66
  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_list_tasks: z.object({ ...target, status: z.enum(['todo', 'in_progress', 'blocked', 'review', 'done']).optional() }).strict(),
67
68
  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
69
  kanban_claim_task: z.object({ ...target, taskId: z.string().min(1).max(32) }).strict(),
69
70
  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(),
@@ -71,6 +72,40 @@ const schemas = {
71
72
  kanban_complete_task: z.object({ ...target, taskId: z.string().min(1).max(32), skipReview: z.boolean().default(false) }).strict(),
72
73
  };
73
74
  export const toolSchemas = schemas;
75
+ const taskRef = { taskId: z.string().min(1).max(32), expectedRevision: z.number().int().min(0).max(Number.MAX_SAFE_INTEGER) };
76
+ export const taskFields = {
77
+ priority: z.enum(['P0', 'P1', 'P2', 'P3']).default('P2'),
78
+ riskLevel: z.enum(['low', 'medium', 'high']).default('medium'),
79
+ dueAt: z.number().int().positive().max(8640000000000000 - 86400000).nullable().default(null),
80
+ };
81
+ /** Server-only contracts are separate so Runner protocol v2 and its tool union stay unchanged. */
82
+ export const taskToolSchemas = {
83
+ task_inbox: z.object({}).strict(),
84
+ task_claim: z.object({ ...taskRef, deviceId: target.deviceId }).strict(),
85
+ task_update: z.object({ ...taskRef, actualPaths: z.array(z.string().max(512)).max(64).optional(), message: z.string().trim().min(1).max(1024).optional(), testJobId: z.string().uuid().optional() }).strict(),
86
+ task_block: z.object({ ...taskRef, blockReason: z.string().trim().min(1).max(1024), needHuman: z.boolean().default(false) }).strict(),
87
+ task_submit: z.object({ ...taskRef, proposedCommitMessage: z.string().max(512).default(''), aiSummary: z.string().max(2048).default(''), fileHashes: z.record(z.string().max(512), sha).refine(value => Object.keys(value).length <= 256).default({}), testJobId: z.string().uuid().optional() }).strict(),
88
+ agent_directory: z.object({}).strict(),
89
+ task_dispatch: z.object({
90
+ projectId: z.string().min(1).max(64).nullable().default(null), deviceId: z.string().min(1).max(100).nullable().default(null),
91
+ assigneePrincipalId: z.string().min(1).max(200), title: z.string().trim().min(1).max(256), description: z.string().max(4096).default(''),
92
+ targetPaths: z.array(z.string().min(1).max(512)).max(32).default([]), requiresReview: z.boolean().default(true), needsWrite: z.boolean().default(true), ...taskFields,
93
+ }).strict(),
94
+ task_review: z.object({ ...taskRef, action: z.enum(['approve', 'reject', 'revise', 'reopen']), reason: z.string().trim().max(1024).default('') }).strict(),
95
+ calendar_context: z.object({}).strict(),
96
+ };
97
+ export const serverToolSchemas = { ...schemas, ...taskToolSchemas };
98
+ const taskDescriptions = {
99
+ task_inbox: 'Your assigned tasks and eligible unclaimed project tasks. No arguments. Includes authorized workspace context and latest cached project note; does not execute Runner tools.',
100
+ task_claim: 'Claim a task from task_inbox using its current revision, acquiring a 30-minute lease. Revalidates your current workspace grants.',
101
+ task_update: 'Report progress, actual paths or a testJobId on your task and renew its unexpired lease. Requires the current revision.',
102
+ task_block: 'Park your task with a block reason and optional request for human assistance. Requires the current revision.',
103
+ task_submit: 'Deliver your task with evidence. Only low-risk tasks with requiresReview=false finish directly; all others enter review.',
104
+ agent_directory: 'Supervisor: list current Agent identities, workspace bindings, device status and active task counts. Does not grant machine access.',
105
+ task_dispatch: 'Supervisor: create and assign a todo task atomically. Project work requires an exact authorized device/project binding on the target Agent.',
106
+ task_review: 'Supervisor: approve, reject, revise or reopen a task at its current revision. High-risk or stale-evidence approvals require the browser administrator.',
107
+ calendar_context: 'Supervisor: read cached busy/free intervals and [DDL] deadlines for the next seven days, including freshness and sync status.',
108
+ };
74
109
  const descriptions = {
75
110
  get_project_context: 'Inspect project manifests, local instructions, configured commands/aliases/environment names and Git state. Does not execute project scripts or expose environment values.',
76
111
  save_project_note: 'Save your bounded project handoff note for the next conversation. Note is tied to this client identity, project and local root; it grants no authority.',
@@ -121,9 +156,17 @@ const descriptions = {
121
156
  kanban_claim_task: 'Claim a todo task, acquiring a 30-minute renewable lease. Returns conflict warnings if paths overlap with in-progress work.',
122
157
  kanban_update_task: 'Update task progress: report actual modified paths or leave a message.',
123
158
  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.',
159
+ kanban_complete_task: 'Complete your low-risk task only when review is not required. skipReview cannot bypass required reviews or risk gates; use task_submit and authorized task_review instead.',
125
160
  };
126
161
  export function toolScope(name) {
162
+ if (name === 'calendar_context')
163
+ return 'calendar:read';
164
+ if (name === 'task_dispatch' || name === 'agent_directory')
165
+ return 'tasks:dispatch';
166
+ if (name === 'task_review')
167
+ return 'tasks:review';
168
+ if (name.startsWith('task_'))
169
+ return 'tasks:self';
127
170
  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))
128
171
  return 'write';
129
172
  if (['start_process', 'run_command', 'write_process_input', 'stop_process', 'start_shell', 'run_shell', 'stop_shell'].includes(name))
@@ -132,9 +175,29 @@ export function toolScope(name) {
132
175
  return 'git';
133
176
  return 'read';
134
177
  }
135
- export const toolDefinitions = Object.entries(schemas).map(([name, schema]) => ({
136
- name, description: descriptions[name],
178
+ export function toolVisible(principal, name) {
179
+ const p = normalizePrincipal(principal);
180
+ if (p.tools && !p.tools.includes(name))
181
+ return false;
182
+ if (name === 'list_devices')
183
+ return p.bindingMode !== 'none' && p.scopes.some(scope => ['read', 'write', 'execute', 'git'].includes(scope));
184
+ if (!Object.hasOwn(serverToolSchemas, name))
185
+ return false;
186
+ if (!p.scopes.includes(toolScope(name)))
187
+ return false;
188
+ if (Object.hasOwn(taskToolSchemas, name)) {
189
+ if (['agent_directory', 'task_dispatch', 'task_review', 'calendar_context'].includes(name))
190
+ return p.agentRole === 'supervisor' && !p.assist;
191
+ return name === 'task_inbox' || p.agentRole !== 'observer';
192
+ }
193
+ if (p.bindingMode === 'none')
194
+ return false;
195
+ return p.agentRole !== 'observer' || toolScope(name) === 'read';
196
+ }
197
+ export const toolDefinitions = Object.entries(serverToolSchemas).map(([name, schema]) => ({
198
+ name, description: Object.hasOwn(taskDescriptions, name) ? taskDescriptions[name]
199
+ : `${name.startsWith('kanban_') ? 'Deprecated compatibility alias; prefer task_inbox/task_claim/task_update/task_submit/task_dispatch. ' : ''}${descriptions[name]}`,
137
200
  inputSchema: z.toJSONSchema(schema, { target: 'draft-7' }),
138
- annotations: { readOnlyHint: toolScope(name) === 'read', destructiveHint: toolScope(name) !== 'read', idempotentHint: false, openWorldHint: ['start_process', 'run_command', 'write_process_input', 'start_shell', 'run_shell', 'git_fetch', 'git_pull', 'git_push'].includes(name) },
201
+ annotations: { readOnlyHint: ['read', 'calendar:read'].includes(toolScope(name)) || ['task_inbox', 'agent_directory'].includes(name), destructiveHint: !['read', 'calendar:read'].includes(toolScope(name)) && !['task_inbox', 'agent_directory'].includes(name), idempotentHint: false, openWorldHint: ['start_process', 'run_command', 'write_process_input', 'start_shell', 'run_shell', 'git_fetch', 'git_pull', 'git_push'].includes(name) },
139
202
  }));
140
203
  //# sourceMappingURL=tools.js.map
@@ -0,0 +1,143 @@
1
+ # Agent dispatch and calendar integration
2
+
3
+ The Server supports project workers and directory-free cloud agents through the
4
+ same `/mcp` endpoint. Runner protocol remains **2**; existing v0.4.21 Runners do not
5
+ need a protocol upgrade. These changes are server-side and introduce no external
6
+ runtime dependencies or destructive SQLite migrations.
7
+
8
+ ## Authorize an Agent
9
+
10
+ Create a PAT or approve OAuth in the console. Choose an Agent role and binding:
11
+
12
+ | Field | Values and behavior |
13
+ | --- | --- |
14
+ | `agentRole` | `worker`, `supervisor`, `observer` (read-only) |
15
+ | `bindingMode` | `bound_projects` or `none` |
16
+ | `displayName` | Human-readable name; authorization still uses `principalId` |
17
+ | `tasks:self` | Inbox, claim, progress, blocking and submission |
18
+ | `tasks:dispatch` | Supervisor Agent directory and dispatch |
19
+ | `tasks:review` | Supervisor review actions |
20
+ | `calendar:read` | Supervisor access to cached personal-calendar context |
21
+
22
+ Roles and scopes are both required. An observer cannot change tasks or files even
23
+ if a write scope was selected. An unbound Agent uses `devices: []` and
24
+ `projectGrants: {}`. It cannot discover devices or invoke machine tools, including
25
+ by calling hidden names directly. Task assignment grants no filesystem authority.
26
+ Changing an existing authorization updates its tools immediately without rotating
27
+ the credential. Scope-restricted refresh tokens remain restricted.
28
+
29
+ Old credentials default to project-bound workers. Legacy write credentials receive
30
+ `tasks:self` at read time, never supervisor powers. Old tasks remain in the **`tasks`**
31
+ KV bucket, with defaults filled on read; reading does not persist migrations or
32
+ renew leases. OAuth consent creates a distinct Agent identity per authorization;
33
+ access/refresh rotation preserves that identity. Existing identities remain valid.
34
+
35
+ ## Unified MCP workflow
36
+
37
+ | Tool | Required permission | Main arguments |
38
+ | --- | --- | --- |
39
+ | `task_inbox()` | `tasks:self` | None |
40
+ | `task_claim` | `tasks:self` | `taskId`, `expectedRevision`, optional `deviceId` |
41
+ | `task_update` | `tasks:self` | `taskId`, `expectedRevision`, optional `message`, `actualPaths`, `testJobId` |
42
+ | `task_block` | `tasks:self` | `taskId`, `expectedRevision`, `blockReason`, optional `needHuman` |
43
+ | `task_submit` | `tasks:self` | `taskId`, `expectedRevision`, optional `aiSummary`, `proposedCommitMessage`, `fileHashes`, `testJobId` |
44
+ | `agent_directory()` | Supervisor + `tasks:dispatch` | None |
45
+ | `task_dispatch` | Supervisor + `tasks:dispatch` | `title`, `assigneePrincipalId`; optional workspace, priority, risk, deadline and review settings |
46
+ | `task_review` | Supervisor + `tasks:review` | `taskId`, `expectedRevision`, `action`, reason for non-approval actions |
47
+ | `calendar_context()` | Supervisor + `calendar:read` | None |
48
+
49
+ Dispatch creates an assigned **todo**, without starting a lease or waking the
50
+ client. Use `projectId: null, deviceId: null` for research, summaries and other
51
+ cloud work. Project dispatch requires an authorized ordinary device/project pair;
52
+ ambiguous devices require an explicit `deviceId`. `needsWrite` defaults to true and
53
+ checks both the target's write scope and the device's active project policy. Set
54
+ it false for read-only research. No inactive fallback project or revoked/paused
55
+ device is eligible.
56
+
57
+ `task_inbox()` returns assigned tasks and eligible unclaimed project tasks, with
58
+ `workspace: {deviceId, projectId, root, readOnly, online}` or `null` for cloud work.
59
+ It does not invoke Runner tools. `project_note` is a cached handoff note for the
60
+ same principal, exact device/project/root, populated by successful
61
+ `save_project_note` / `get_project_context` calls after this upgrade; it is null
62
+ when unavailable. Notes require the Agent's read scope. Root changes invalidate
63
+ the cache key. Notes and workspace text are guidance, not authorization.
64
+ Receipts bound accumulated histories; inbox returns `total` and `truncated`, with
65
+ active assigned work first and a limit of 200 tasks plus the transport byte budget.
66
+ The administrator board exposes a more detailed bounded evidence/history view.
67
+
68
+ Claim starts a 30-minute lease. Only the assignee can update, block or submit;
69
+ revision conflicts return `409 conflict`. Active worker calls renew only matching,
70
+ unexpired leases. Browser polls, comments and Runner heartbeats do not. A blocked
71
+ task parks its lease and can request human help even after losing its write scope.
72
+ The administrator can grant selected write/execute/Git scopes for **30 minutes**
73
+ and reopen it; device policy and tool restrictions still apply. As with other
74
+ authorization edits, this cancels that authorization's existing managed work.
75
+
76
+ The five states are `todo`, `in_progress`, `blocked`, `review`, `done`. New dispatch
77
+ defaults to `priority: P2`, `riskLevel: medium`, `requiresReview: true`. Submission
78
+ finishes immediately only for **low** risk with `requiresReview: false`. All other
79
+ work enters review. Supervisors may approve, reject, revise or reopen. Approval of
80
+ **high** risk or stale review paths requires the browser administrator; compatibility
81
+ tools cannot bypass this. File hashes are client evidence, not independently verified.
82
+ A `testJobId` must belong to the assignee and exact device/project; stored Runner
83
+ observations determine whether that job passed.
84
+
85
+ The six `kanban_*` names remain deprecated compatibility tools with their existing
86
+ project/device arguments and read/write scopes. Their ownership, lease and risk
87
+ checks are enforced too. `kanban_complete_task` no longer lets workers skip a
88
+ required or high-risk review. Use `task_submit` and authorized review instead.
89
+
90
+ ## Calendar configuration
91
+
92
+ `CALENDAR_PROVIDER=none` is the default: no timer, outbound request or calendar UI.
93
+ The optional adapter refreshes about once a minute, caches the next seven days of
94
+ busy intervals and events whose title contains `[DDL]`, and never caches other
95
+ personal event titles. Stale or failed reads never advertise unknown time as free.
96
+ Provider errors are sanitized, credentials remain in environment configuration,
97
+ requests have timeouts and bounded responses, and redirects are rejected.
98
+
99
+ For Google, set `CALENDAR_PROVIDER=google`, `CALENDAR_ID` (default `primary`) and
100
+ either `CALENDAR_ACCESS_TOKEN` or all of `CALENDAR_CLIENT_ID`,
101
+ `CALENDAR_CLIENT_SECRET`, `CALENDAR_REFRESH_TOKEN`. Obtain credentials outside
102
+ HomeAgent with calendar read access and permission to create/update the tasks
103
+ calendar. Short-lived access tokens alone require manual renewal. HomeAgent has no
104
+ Google login/consent flow. Google recurring instances are requested expanded;
105
+ all-day dates use the calendar's timezone.
106
+
107
+ Google writeback creates **HomeAgent Tasks** automatically, or uses an explicitly
108
+ configured `CALENDAR_TASKS_ID`. It must be a separate secondary calendar, never the
109
+ personal calendar. Event IDs are stable; later syncs update the same task event.
110
+
111
+ For CalDAV, set `CALENDAR_PROVIDER=caldav`, `CALENDAR_URL`, `CALENDAR_USERNAME`,
112
+ `CALENDAR_PASSWORD`, and `CALENDAR_TIMEZONE` to the personal calendar's IANA zone
113
+ (default UTC). Collection URLs require HTTPS, except loopback, and a trailing slash.
114
+ The server must support expanded `calendar-query` REPORTs in UTC. Unexpanded
115
+ recurrence/floating-time responses fail closed. Add `CALENDAR_TASKS_URL` pointing to
116
+ a **separately created collection** for writeback; omit it for read-only context.
117
+ Writes use UTC iCalendar events and ETag preconditions when provided by the server.
118
+
119
+ Due tasks and high-risk reviews are written to the tasks calendar; done tasks or
120
+ tasks that no longer need reminders remove their corresponding event. Events are
121
+ transparent so they do not reserve execution time. Calendar metadata updates do
122
+ not change task revisions or leases. Calendar writeback never modifies personal
123
+ events and does not import external edits as task commands or approval decisions.
124
+
125
+ ## Console and administrator API
126
+
127
+ The board supports project, supervisor/all-Agent and individual-Agent perspectives,
128
+ five columns, deadline/risk badges, directory-aware assignment, test-output links,
129
+ and a blocked-task temporary-permission action. In assignment controls, ineligible
130
+ Agents are visible but disabled. New assignments wait for `task_claim`; the existing
131
+ drag-to-progress administrator action still starts its lease immediately.
132
+
133
+ All `/api/kanban` routes require an administrator session; writes require CSRF.
134
+ `GET /agents` returns capabilities, `GET /calendar` returns sync context,
135
+ `GET /assignees?projectId=...` returns eligible `assignees` plus all annotated
136
+ `agents`. Board/list queries accept `projectId=~` for cloud tasks, `projectId=*`
137
+ or an omitted filter for all tasks. JSON create/edit actions use `projectId: null`
138
+ for cloud tasks. `POST /tasks/:id/elevate` takes `projectId`, `expectedRevision`
139
+ and selected `scopes` (`write`, `execute`, `git`), with an exact blocked assignment.
140
+
141
+ Run `npm run verify`. Provider tests use mocked Google/CalDAV responses; the MCP
142
+ regression suite also exercises dispatch, inbox, claim, note caching, submission
143
+ and review against the unchanged real protocol-v2 Runner.
@@ -0,0 +1,111 @@
1
+ # Agent 调度与日历联动
2
+
3
+ Server 在同一个 `/mcp` 入口支持目录绑定执行者和无目录云端主管。Runner 协议仍为
4
+ **2**,现有 v0.4.21 Runner 无需升级协议。不引入运行时依赖,不破坏 SQLite 表结构。
5
+
6
+ ## 主体与授权
7
+
8
+ PAT 创建页、OAuth 授权页和已有令牌编辑页均支持:
9
+
10
+ - `agentRole`:`worker` 执行者、`supervisor` 主管、`observer` 只读观察者。
11
+ - `bindingMode`:`bound_projects` 绑定项目,或 `none` 无目录。
12
+ - `displayName`:可读名称;权限与指派使用稳定的 `principalId`。
13
+ - `tasks:self`:收件箱、认领、进度、阻塞、交付。
14
+ - `tasks:dispatch`:主管查询 Agent 目录并派单。
15
+ - `tasks:review`:主管审校。
16
+ - `calendar:read`:主管读取缓存中的个人日历忙闲。
17
+
18
+ 角色与 scope 必须同时满足。观察者不能修改任务或文件。无目录主体必须使用
19
+ `devices: []`、`projectGrants: {}`;即使误配机器 scope,也不能发现设备或直接调用
20
+ 隐藏的文件、终端、Git 工具。修改现有授权即时生效,无需重新复制令牌。
21
+
22
+ 旧主体按绑定目录的 worker 兼容;旧 write 授权在读取时获得 `tasks:self`,不会获得
23
+ 主管权限。旧任务继续使用实际的 **`tasks`** KV 桶;读取时补默认值,不写迁移、不续租。
24
+ 每次新的 OAuth 同意分别生成 Agent 身份;access/refresh 轮换保持该身份,历史身份保留。
25
+
26
+ ## 统一 MCP 流程
27
+
28
+ | 工具 | 权限 | 主要参数 |
29
+ | --- | --- | --- |
30
+ | `task_inbox()` | `tasks:self` | 无参数 |
31
+ | `task_claim` | `tasks:self` | `taskId`、`expectedRevision`,可选 `deviceId` |
32
+ | `task_update` | `tasks:self` | 任务与 revision,可选 `message`、`actualPaths`、`testJobId` |
33
+ | `task_block` | `tasks:self` | 任务与 revision、`blockReason`,可选 `needHuman` |
34
+ | `task_submit` | `tasks:self` | 任务与 revision,可选摘要、提交信息、哈希、`testJobId` |
35
+ | `agent_directory()` | 主管 + `tasks:dispatch` | 无参数 |
36
+ | `task_dispatch` | 主管 + `tasks:dispatch` | 标题、`assigneePrincipalId`,可选目录、风险、优先级、DDL |
37
+ | `task_review` | 主管 + `tasks:review` | 任务与 revision、`approve/reject/revise/reopen`,非批准操作需原因 |
38
+ | `calendar_context()` | 主管 + `calendar:read` | 无参数 |
39
+
40
+ 派单创建**已指定负责人的待办任务**,不会启动租约或唤醒 Agent。研究、总结等纯云端
41
+ 工作使用 `projectId: null, deviceId: null`。目录任务必须通过目标主体的设备/项目
42
+ 授权与当前有效设备策略交集;多台设备存在歧义时需显式选择设备。`needsWrite` 默认
43
+ 为 true,同时检查目标 write scope 和设备只读限制;只读调研可以设为 false。
44
+
45
+ 零参收件箱返回名下任务和有权认领的项目待办,附带
46
+ `workspace: {deviceId, projectId, root, readOnly, online}`;云端任务为 null。
47
+ 收件箱不执行 Runner 工具。`project_note` 来自升级后成功的 `save_project_note` /
48
+ `get_project_context` 调用缓存,按主体、设备、项目和根目录隔离;缺失时为 null,
49
+ 读取需 read scope。根目录变化自动使旧缓存失效;任务文字和笔记均不是授权凭据。
50
+ 收件箱优先展示名下未完成任务,限制 200 项及传输字节预算,返回 `total`、`truncated`;
51
+ 累积消息等历史有明确总数与截断;管理员看板提供更详细的受限证据与历史视图。
52
+
53
+ 认领取得 30 分钟租约;只有负责人可以更新、阻塞和交付。revision 过期返回
54
+ `409 conflict`。活跃机器操作仅续租同一主体、设备、项目下的未过期任务;浏览器轮询、
55
+ 备注和 Runner 心跳不续租。阻塞会暂停租约,即使失去 write scope,仍可报告原因并请求
56
+ 人工介入。管理员可以选定 write/execute/Git 权限,临时授权 **30 分钟**并重开任务;
57
+ 设备策略与工具白名单仍有效。与其他授权变更一致,这会取消该授权正在托管的工作。
58
+
59
+ 五态为 `todo / in_progress / blocked / review / done`。新派单默认 P2、中风险、需审核。
60
+ 只有 **low 且 requiresReview=false** 直接完成;其他均提审。主管可批准、驳回、退修、
61
+ 重开,但**高风险或证据路径过期**必须由浏览器管理员确认。旧工具不能绕过此门控。
62
+ 哈希仍是客户端证据,不代表独立验证;`testJobId` 则必须属于负责人及同一设备/项目,
63
+ 测试是否通过来自已存储的 Runner 作业观察记录。
64
+
65
+ 六个 `kanban_*` 保留为 deprecated 兼容工具,保持原项目/设备参数及 read/write scope,
66
+ 并执行负责人、租约与风险检查。`kanban_complete_task` 不再允许执行者跳过必须的审核;
67
+ 请迁移到 `task_submit` 与有权限的审校流程。
68
+
69
+ ## 可选日历配置
70
+
71
+ 默认 `CALENDAR_PROVIDER=none`:不启动日历定时器、不访问外部服务、不显示日历栏。
72
+ 开启后约每分钟同步未来七天的忙闲与 `[DDL]` 标题事件;其他私人事件标题不写入缓存。
73
+ 缓存过期或同步失败不会将未知时段宣称为空闲。凭据仅保留在环境配置中,错误信息脱敏,
74
+ 请求有超时和响应大小上限,禁止跟随重定向。
75
+
76
+ Google 设置 `CALENDAR_PROVIDER=google`、`CALENDAR_ID`(默认 primary),以及以下之一:
77
+
78
+ - `CALENDAR_ACCESS_TOKEN`,到期后需手动更新。
79
+ - `CALENDAR_CLIENT_ID`、`CALENDAR_CLIENT_SECRET`、`CALENDAR_REFRESH_TOKEN`,支持自动刷新。
80
+
81
+ 需自行在 HomeAgent 外取得具有读日历、创建及维护任务副日历能力的凭据;本实现没有
82
+ Google 登录授权流程。重复事件请求展开实例,全天事件按日历时区处理。未配置
83
+ `CALENDAR_TASKS_ID` 时自动创建 **HomeAgent Tasks**;显式配置时必须是独立副日历,
84
+ 不能使用个人主日历。事件 ID 稳定,重复同步更新同一个任务提醒。
85
+
86
+ CalDAV 设置 `CALENDAR_PROVIDER=caldav`、`CALENDAR_URL`、`CALENDAR_USERNAME`、
87
+ `CALENDAR_PASSWORD`,并将 `CALENDAR_TIMEZONE` 设为个人日历的 IANA 时区(默认 UTC)。
88
+ 集合 URL 必须 HTTPS(回环地址例外)且以 `/` 结尾。服务端需支持按 UTC 展开实例的
89
+ `calendar-query REPORT`;未展开重复规则或 floating time 会同步失败并安全关闭空闲推断。
90
+ 如需回写,请先创建**独立任务集合**并设置 `CALENDAR_TASKS_URL`;不设置则只读。
91
+ 回写使用 UTC iCalendar 事件;服务端返回 ETag 时使用并发前置条件。
92
+
93
+ 有截止时间的未完成任务和高风险待审任务会回写独立任务日历;完成或移除提醒条件后,
94
+ 删除对应事件。提醒为 transparent,不占用个人空闲时间。日历元数据不改变任务 revision
95
+ 或租约。回写不修改个人事件,也不将外部日历编辑当成任务指令或审批决定。
96
+
97
+ ## 看板与管理员 API
98
+
99
+ 看板保留原有拖拽、移动端 Tab、冲突草稿保护,新增五列、项目/主管/Agent 视角、
100
+ Agent 能力条、风险/DDL 标签、目录感知派单、测试输出跳转与阻塞临时授权按钮。
101
+ 非法执行者可见但灰显。新建派单等待 Agent 主动认领;原有拖到进行中的管理员动作
102
+ 继续保持立即开始租约的行为。
103
+
104
+ `/api/kanban` 全部要求管理员会话,修改要求 CSRF。新增 `/agents` 和 `/calendar` 读取接口。
105
+ `/assignees?projectId=...` 返回合法 `assignees` 与附带合法性原因的全部 `agents`。
106
+ 看板/列表查询使用 `projectId=~` 表示无目录,`projectId=*` 或省略表示全部;JSON
107
+ 任务操作使用 `projectId: null`。`POST /tasks/:id/elevate` 接收项目、expectedRevision
108
+ 与选定的 `scopes`,只作用于拥有确切负责人和目录的阻塞任务。
109
+
110
+ 运行 `npm run verify`。Google/CalDAV 使用模拟响应测试;真实协议 v2 Runner 的本地
111
+ MCP 测试覆盖主管派单 → inbox → 认领 → 笔记缓存 → 提审 → 主管批准,不依赖外部账户。
@@ -2,10 +2,16 @@
2
2
 
3
3
  **English** · [简体中文](ARCHITECTURE.zh-CN.md)
4
4
 
5
- HomeAgent v0.4.20 builds on the v0.3 context/editor/output-log/patch foundation with a permission protocol, a Dashboard permission editor, controlled Git network tools, fuzzy unified diffs, persistent stateful shell sessions and lightweight LSP integration. The MCP catalogue now contains **51 tools** (50 Zod schemas in `src/shared/tools.ts` plus the separately defined `list_devices`). Device capability ceilings and client authorizations are stored separately; temporary grants expire and trigger job revocation. Execution semantics and persistence/recovery of the newer tools are covered in the [Development Workflow](DEVELOPMENT_WORKFLOW.md).
5
+ HomeAgent v0.5.0 builds on the v0.3 context/editor/output-log/patch foundation with a permission protocol, a Dashboard permission editor, controlled Git network tools, fuzzy unified diffs, persistent stateful shell sessions and lightweight LSP integration. The MCP catalogue now contains **60 tools** (59 Zod schemas in `src/shared/tools.ts` plus the separately defined `list_devices`). Device capability ceilings and client authorizations are stored separately; temporary grants expire and trigger job revocation. Execution semantics and persistence/recovery of the newer tools are covered in the [Development Workflow](DEVELOPMENT_WORKFLOW.md).
6
6
 
7
7
  ## Data Flow and Trust Boundaries
8
8
 
9
+ Agent roles, task scopes and workspace bindings also govern the Server-side task
10
+ tools. Directory-free supervisors cannot invoke Runner tools. Task/calendar scopes
11
+ stay on the Server and are removed from protocol-v2 machine call frames for older
12
+ Runner compatibility. The optional calendar adapter caches busy/deadline context
13
+ and writes task reminders to a separate calendar. See [Agent dispatch](AGENT_DISPATCH.md).
14
+
9
15
  ```mermaid
10
16
  flowchart LR
11
17
  AI[AI MCP Client] -->|HTTPS /mcp + OAuth or PAT| S[Server]
@@ -2,10 +2,15 @@
2
2
 
3
3
  [English](ARCHITECTURE.md) · **简体中文**
4
4
 
5
- HomeAgent v0.4.20 在 v0.3 的 context/editor/output-log/patch 基础上,增加权限协议、Dashboard 权限编辑器、受控 Git 网络工具、统一 diff 模糊重定位、持久状态化 Shell 会话与轻量 LSP 集成。MCP 目录当前共 **51 个工具**(`src/shared/tools.ts` 中的 50 个 Zod schema,加上单独定义的 `list_devices`)。设备能力上限与客户端授权分层保存,临时授权可过期并触发任务收回。新增工具的执行语义和持久化恢复详见 [日常开发工作流](DEVELOPMENT_WORKFLOW.zh-CN.md)。
5
+ HomeAgent v0.5.0 在 v0.3 的 context/editor/output-log/patch 基础上,增加权限协议、Dashboard 权限编辑器、受控 Git 网络工具、统一 diff 模糊重定位、持久状态化 Shell 会话与轻量 LSP 集成。MCP 目录当前共 **60 个工具**(`src/shared/tools.ts` 中的 59 个 Zod schema,加上单独定义的 `list_devices`)。设备能力上限与客户端授权分层保存,临时授权可过期并触发任务收回。新增工具的执行语义和持久化恢复详见 [日常开发工作流](DEVELOPMENT_WORKFLOW.zh-CN.md)。
6
6
 
7
7
  ## 数据流与信任边界
8
8
 
9
+ Server 端任务工具还受 Agent 角色、任务 scope 与目录绑定控制。无目录主管不能调用
10
+ Runner 工具。任务/日历 scope 留在 Server,转发协议 v2 机器调用时会移除,以兼容旧版
11
+ Runner。可选日历适配器缓存忙闲与 DDL,并将任务提醒回写独立副日历,详见
12
+ [Agent 调度](AGENT_DISPATCH.zh-CN.md)。
13
+
9
14
  ```mermaid
10
15
  flowchart LR
11
16
  AI[AI MCP Client] -->|HTTPS /mcp + OAuth or PAT| S[Server]
package/docs/CLIENTS.md CHANGED
@@ -16,7 +16,7 @@ Make sure the Runner is paired and online, the client can reach `https://mcp.exa
16
16
 
17
17
  The following is kept as a historical troubleshooting record. In v0.3.0 the authorization form redirected directly to an external callback, which Chrome could block under `form-action 'self'`; the authorization request was already consumed, so a second click showed `Authorization request expired`. **The fix was to upgrade the Server to v0.3.1**: that version first shows an on-site completion page before returning to the registered client, retains strict CSP, and shows a submitting state on the button to prevent double submits.
18
18
 
19
- After upgrading, restart the Server and start a fresh OAuth authorization from the AI client; do not refresh or re-submit the old tab. For npm deployments upgrade the `homeagent-server` package and restart the corresponding service; the Runner uses the separate `homeagent-runner` package and both should be upgraded to the same version. For Compose deployments check out `v0.4.20`, rebuild and start again, keeping the original `.env` and data volume. A Runner v0.3.0 did not need upgrading for the OAuth callback fix; to use v0.4 Web permission management, both Server and Runner should be on v0.4.20.
19
+ After upgrading, restart the Server and start a fresh OAuth authorization from the AI client; do not refresh or re-submit the old tab. For npm deployments upgrade the `homeagent-server` package and restart the corresponding service; the Runner uses the separate `homeagent-runner` package and both should be upgraded to the same version. For Compose deployments check out `v0.5.0`, rebuild and start again, keeping the original `.env` and data volume. A Runner v0.3.0 did not need upgrading for the OAuth callback fix; to use v0.4 Web permission management, both Server and Runner should be on v0.4.21.
20
20
 
21
21
  If the completion page does not return automatically, click "Continue back to client". A used or expired authorization code is never re-issued; if the client is still not connected, create a new authorization request from the client. Device credentials and completed client authorizations are not proactively cleared by an upgrade.
22
22
 
@@ -16,7 +16,7 @@
16
16
 
17
17
  以下保留为历史排错记录。v0.3.0 的授权表单直接重定向到外部回调,Chrome 可能按 `form-action 'self'` 拦截该跳转;授权请求却已被消费,第二次点击便显示 `Authorization request expired`。**修复方式是升级 Server 到 v0.3.1**:新版本先进入站内完成页,再返回已注册客户端,保留严格 CSP;按钮显示提交状态并防止重复提交。
18
18
 
19
- 升级后重启 Server,回到 AI 客户端重新发起 OAuth 授权,不要刷新或重复提交旧标签页。npm 部署升级 `homeagent-server` 包后重启对应服务;Runner 使用独立的 `homeagent-runner` 包,两者应升级到相同版本。Compose 部署检出 `v0.4.20` 后重新构建并启动,保留原 `.env` 和数据卷。Runner v0.3.0 不需要为 OAuth 回调修复升级;要使用 v0.4 的 Web 权限管理,则 Server 和 Runner 都应升级到 v0.4.20。
19
+ 升级后重启 Server,回到 AI 客户端重新发起 OAuth 授权,不要刷新或重复提交旧标签页。npm 部署升级 `homeagent-server` 包后重启对应服务;Runner 使用独立的 `homeagent-runner` 包,两者应升级到相同版本。Compose 部署检出 `v0.5.0` 后重新构建并启动,保留原 `.env` 和数据卷。Runner v0.3.0 不需要为 OAuth 回调修复升级;要使用 v0.4 的 Web 权限管理,则 Server 和 Runner 都应升级到 v0.4.21。
20
20
 
21
21
  若完成页没有自动返回,点击"继续返回客户端"。已使用或过期的授权码不会被重新签发;客户端仍未连接时,从客户端新建一次授权请求。设备凭据及已完成的客户端授权不因升级被主动清空。
22
22
 
@@ -97,7 +97,7 @@ To keep running after logout and to start at boot, an administrator should run `
97
97
  Check out the release source on a server with Docker Engine, Compose v2 and Git:
98
98
 
99
99
  ```sh
100
- git clone --branch v0.4.20 --depth 1 https://github.com/jhxxr/HomeAgent.git
100
+ git clone --branch v0.5.0 --depth 1 https://github.com/jhxxr/HomeAgent.git
101
101
  cd HomeAgent
102
102
  ```
103
103
 
@@ -97,7 +97,7 @@ journalctl --user -u homeagent-server -f
97
97
  先在有 Docker Engine、Compose v2 和 Git 的服务器检出发布源码:
98
98
 
99
99
  ```sh
100
- git clone --branch v0.4.20 --depth 1 https://github.com/jhxxr/HomeAgent.git
100
+ git clone --branch v0.5.0 --depth 1 https://github.com/jhxxr/HomeAgent.git
101
101
  cd HomeAgent
102
102
  ```
103
103
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  **English** · [简体中文](OPEN_SOURCE.zh-CN.md)
4
4
 
5
- This repository releases its original source under the MIT License at version 0.4.20; the npm release is split into two packages, `homeagent-server` and `homeagent-runner`. The Server package contains only the compiled Server, Dashboard and Server assets; the Runner package contains only the Runner, the shared protocol and the Windows process-tree helper. The CLI and source share the same license; both npm packages use file allowlists to include only files needed at runtime, documentation and licenses. Package-name availability and account publish permissions are as determined by the registry at release time.
5
+ This repository releases its original source under the MIT License at version 0.5.0; the npm release is split into two packages, `homeagent-server` and `homeagent-runner`. The Server package contains only the compiled Server, Dashboard and Server assets; the Runner package contains only the Runner, the shared protocol and the Windows process-tree helper. The CLI and source share the same license; both npm packages use file allowlists to include only files needed at runtime, documentation and licenses. Package-name availability and account publish permissions are as determined by the registry at release time.
6
6
 
7
7
  ## File Layout
8
8
 
@@ -57,7 +57,7 @@ npm run release:source
57
57
 
58
58
  Output goes to the ignored `release/`:
59
59
 
60
- - `HomeAgent-v0.4.20-source.tar.gz`
60
+ - `HomeAgent-v0.5.0-source.tar.gz`
61
61
  - the corresponding `.sha256` checksum file
62
62
  - the corresponding `.manifest.txt`, including version, Git commit and all release paths
63
63
 
@@ -69,8 +69,8 @@ If old Git/runtime data from before the rebuild was kept in a private backup out
69
69
 
70
70
  `npm run release:npm` builds the JavaScript, packs the two packages separately with `--ignore-scripts`, checks archive file allowlists, runtime assets and SHA-512 integrity, and outputs:
71
71
 
72
- - `release/homeagent-server-0.4.20.tgz`
73
- - `release/homeagent-runner-0.4.20.tgz`
72
+ - `release/homeagent-server-0.5.0.tgz`
73
+ - `release/homeagent-runner-0.5.0.tgz`
74
74
  - a `.sha256` for each archive
75
75
  - `release/npm-packages.json`: both packages' names, versions, Git commit, checksum, dist-tag and path lists
76
76
 
@@ -80,20 +80,20 @@ If old Git/runtime data from before the rebuild was kept in a private backup out
80
80
 
81
81
  `.github/workflows/release.yml` supports two entry points:
82
82
 
83
- 1. Push a version tag, for example `v0.4.20`.
83
+ 1. Push a version tag, for example `v0.5.0`.
84
84
  2. In Actions → release → Run workflow, enter an **already existing** version tag.
85
85
 
86
86
  Configure `NPM_TOKEN` as described in the next section. After the initial source push, configuring the real `origin` and confirming Actions are available, you can publish as follows:
87
87
 
88
88
  ```sh
89
89
  # First commit this version's source and docs, keeping the working tree clean
90
- git tag -a v0.4.20 -m "HomeAgent v0.4.20"
91
- git push origin v0.4.20
90
+ git tag -a v0.5.0 -m "HomeAgent v0.5.0"
91
+ git push origin v0.5.0
92
92
  ```
93
93
 
94
94
  This document is release documentation only; the preparation scripts do not execute these commands for the operator.
95
95
 
96
- The tag must match `package.json`, `package-lock.json` and the runtime VERSION, and `CHANGELOG.md` must have a non-empty entry for that version. A prerelease may use `v0.4.20-rc.1` (all related version files must then be `0.4.20-rc.1`). Do not disguise an ordinary branch or a mismatched version as a release.
96
+ The tag must match `package.json`, `package-lock.json` and the runtime VERSION, and `CHANGELOG.md` must have a non-empty entry for that version. A prerelease may use `v0.5.0-rc.1` (all related version files must then be `0.5.0-rc.1`). Do not disguise an ordinary branch or a mismatched version as a release.
97
97
 
98
98
  The release pipeline runs in order:
99
99
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  [English](OPEN_SOURCE.md) · **简体中文**
4
4
 
5
- 本仓库以 MIT 开放原始代码,版本为 0.4.20,npm 发布拆成 `homeagent-server` 和 `homeagent-runner` 两个包。Server 包只包含编译后的 Server、Dashboard 和 Server 资源;Runner 包只包含 Runner、共享协议和 Windows 进程树辅助代码。CLI 和源码采用相同许可证;两个 npm 包都通过文件白名单只包含运行所需文件、文档和许可证。包名是否可用及账号发布权限以发布当时的 registry 为准。
5
+ 本仓库以 MIT 开放原始代码,版本为 0.5.0,npm 发布拆成 `homeagent-server` 和 `homeagent-runner` 两个包。Server 包只包含编译后的 Server、Dashboard 和 Server 资源;Runner 包只包含 Runner、共享协议和 Windows 进程树辅助代码。CLI 和源码采用相同许可证;两个 npm 包都通过文件白名单只包含运行所需文件、文档和许可证。包名是否可用及账号发布权限以发布当时的 registry 为准。
6
6
 
7
7
  ## 文件划分
8
8
 
@@ -57,7 +57,7 @@ npm run release:source
57
57
 
58
58
  输出位于被忽略的 release/:
59
59
 
60
- - `HomeAgent-v0.4.20-source.tar.gz`
60
+ - `HomeAgent-v0.5.0-source.tar.gz`
61
61
  - 对应 `.sha256` 校验文件
62
62
  - 对应 `.manifest.txt`,包括版本、Git 提交和全部发布路径
63
63
 
@@ -69,8 +69,8 @@ npm run release:source
69
69
 
70
70
  `npm run release:npm` 构建 JavaScript、以 `--ignore-scripts` 分别打包两个包,并检查归档文件白名单、运行资源及 SHA-512 完整性,输出:
71
71
 
72
- - `release/homeagent-server-0.4.20.tgz`
73
- - `release/homeagent-runner-0.4.20.tgz`
72
+ - `release/homeagent-server-0.5.0.tgz`
73
+ - `release/homeagent-runner-0.5.0.tgz`
74
74
  - 两个归档各自的 `.sha256`
75
75
  - `release/npm-packages.json`:两个包的名称、版本、Git commit、校验、dist-tag 和路径清单
76
76
 
@@ -80,20 +80,20 @@ npm run release:source
80
80
 
81
81
  `.github/workflows/release.yml` 支持两种入口:
82
82
 
83
- 1. 推送版本标签,例如 `v0.4.20`。
83
+ 1. 推送版本标签,例如 `v0.5.0`。
84
84
  2. 在 Actions → release → Run workflow 中填写**已经存在**的版本标签。
85
85
 
86
86
  先按下一节配置 `NPM_TOKEN`。首次推送源码、配置真实 `origin` 并确认 Actions 可用后,可以按下面方式发布:
87
87
 
88
88
  ```sh
89
89
  # 先提交本次版本的源码和文档,工作区保持干净
90
- git tag -a v0.4.20 -m "HomeAgent v0.4.20"
91
- git push origin v0.4.20
90
+ git tag -a v0.5.0 -m "HomeAgent v0.5.0"
91
+ git push origin v0.5.0
92
92
  ```
93
93
 
94
94
  本文只是发布说明,准备脚本不会替操作者执行这些命令。
95
95
 
96
- 标签必须与 package.json、package-lock.json 及 runtime VERSION 一致,CHANGELOG.md 必须有对应版本的非空条目。预发布可用 `v0.4.20-rc.1`(相关版本文件也必须为 `0.4.20-rc.1`)。禁止把普通分支或不匹配版本伪装成发布。
96
+ 标签必须与 package.json、package-lock.json 及 runtime VERSION 一致,CHANGELOG.md 必须有对应版本的非空条目。预发布可用 `v0.5.0-rc.1`(相关版本文件也必须为 `0.5.0-rc.1`)。禁止把普通分支或不匹配版本伪装成发布。
97
97
 
98
98
  发布流水线按次序执行:
99
99
 
package/docs/TOOLS.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  **English** · [简体中文](TOOLS.zh-CN.md)
4
4
 
5
- The 13 development tools introduced in v0.3, command aliases / environment profiles, batch-edit recovery and safe commits are fully described in the [Development Workflow](DEVELOPMENT_WORKFLOW.md). v0.4 added controlled Git network operations, a Web permission editor, fuzzy unified-diff hunk relocation, persistent shell sessions and lightweight LSP integration. The current release exposes **51 MCP tools**. The v0.2 APIs below remain available; the exclusion strategies for Git add and diff were tightened.
5
+ The 13 development tools introduced in v0.3, command aliases / environment profiles, batch-edit recovery and safe commits are fully described in the [Development Workflow](DEVELOPMENT_WORKFLOW.md). v0.4 added controlled Git network operations, a Web permission editor, fuzzy unified-diff hunk relocation, persistent shell sessions and lightweight LSP integration. The current release exposes **60 MCP tools before per-Agent filtering**. The v0.2 APIs below remain available; the exclusion strategies for Git add and diff were tightened.
6
6
 
7
7
  ## Permission Combinations
8
8
 
@@ -73,6 +73,8 @@ blocks file operations.
73
73
 
74
74
  ### Server-side task coordination
75
75
 
76
+ See [Agent dispatch and calendar integration](AGENT_DISPATCH.md) for the nine unified, role/scope-protected task tools, zero-argument `task_inbox()` and calendar configuration. The six project tools below remain deprecated compatibility entry points.
77
+
76
78
  All six tools require `projectId` and respect the current token's tool, scope and
77
79
  per-device project grants. They operate in the Server database without Runner
78
80
  filesystem access, so an authorized offline device is sufficient; revoked, paused
@@ -89,9 +91,8 @@ to an assignee.
89
91
  - `kanban_update_task(taskId,actualPaths?,message?)`: merge reported paths, add progress
90
92
  messages and renew the task lease.
91
93
  - `kanban_submit_review(taskId,proposedCommitMessage,aiSummary="",fileHashes={})`:
92
- store review evidence and enter review, or finish when review is not required.
93
- - `kanban_complete_task(taskId,skipReview=false)`: complete a review task; explicit
94
- `skipReview` also allows completing in-progress work. It does not create a Git commit.
94
+ store review evidence and enter review; only low-risk work with review disabled finishes directly.
95
+ - `kanban_complete_task(taskId,skipReview=false)`: compatibility completion is limited to low-risk, no-review work owned by the caller. Required reviews need `task_review` or the administrator; `skipReview` cannot bypass risk gates. No Git commit is created.
95
96
 
96
97
  Active tool calls renew unexpired leases only for matching assignee, device and
97
98
  project. Runner heartbeat alone does not keep abandoned work leased. Successful
@@ -101,6 +102,31 @@ Shell commands and external editors do not provide automatic path tracking.
101
102
  These file tools also return advisory `reviewWarnings` for paths awaiting review;
102
103
  this is not an enforced lock or an independent verification of submitted hashes.
103
104
 
105
+ ### Web project board
106
+
107
+ The administrator console's **Project Kanban** tab provides a five-column board,
108
+ a list view, project/device/client filters, search, creation, task editing, comments
109
+ and a detail drawer with submitted evidence and activity history. Desktop cards can
110
+ be dragged to another state; **Move to…** in task details provides the same actions
111
+ for keyboard and mobile users. Invalid transitions leave the task unchanged.
112
+
113
+ Moving a todo or completed task into progress requires selecting a currently
114
+ write-authorized client and device. This assigns metadata only; it does not wake an
115
+ AI client or run commands. Moving in-progress work into review requires a proposed
116
+ commit message and delivery summary, without fabricating verified hashes. Moving
117
+ reviewed work into done requires confirmation; finishing in-progress work explicitly
118
+ confirms skipping review. Release, rejection, revision and reopening require a reason.
119
+ None of these actions stops Runner processes, reverts files or creates a Git commit.
120
+
121
+ Visible boards refresh every five seconds. Comments and browser polling never renew
122
+ worker leases. All modifying requests use the administrator session, CSRF protection
123
+ and an expected task revision; a concurrent update returns `409 conflict`, preserving
124
+ the browser draft for explicit reload. Historical unavailable projects remain readable;
125
+ creating/editing tasks and assigning workers require current configured membership.
126
+ The UI labels bounded path/message/hash histories and distinguishes client-provided
127
+ evidence from independent verification. Review staleness reflects confirmed built-in
128
+ file-tool changes only, not arbitrary shell commands or external editors.
129
+
104
130
  ## LSP and Code-Intelligence Tools
105
131
 
106
132
  - `lsp_document_symbols(path)`: extracts structured source symbols (classes, interfaces, types, enums, functions, methods, constants, variables, etc.), exact line/column ranges, doc comments and module import relations.
@@ -2,7 +2,7 @@
2
2
 
3
3
  [English](TOOLS.md) · **简体中文**
4
4
 
5
- v0.3 新增的 13 个开发工具、命令别名/环境配置、批量编辑恢复和安全提交的完整说明见 [日常开发工作流](DEVELOPMENT_WORKFLOW.zh-CN.md)。v0.4 增加受控 Git 网络操作、Web 权限编辑器、统一 diff 模糊重定位、持久 Shell 会话与轻量 LSP 集成,当前共 **51 个 MCP 工具**。下列 v0.2 原有 API 继续保留;Git add 和 diff 的排除策略有所收紧。
5
+ v0.3 新增的 13 个开发工具、命令别名/环境配置、批量编辑恢复和安全提交的完整说明见 [日常开发工作流](DEVELOPMENT_WORKFLOW.zh-CN.md)。v0.4 增加受控 Git 网络操作、Web 权限编辑器、统一 diff 模糊重定位、持久 Shell 会话与轻量 LSP 集成,当前共 **60 个 MCP 工具(按主体裁剪)**。下列 v0.2 原有 API 继续保留;Git add 和 diff 的排除策略有所收紧。
6
6
 
7
7
  ## 权限组合
8
8
 
@@ -70,6 +70,8 @@ Runner 优先使用 `HOMEAGENT_WORKSPACE` 指定的记忆工作区;否则,
70
70
 
71
71
  ### Server 端任务协作
72
72
 
73
+ 统一任务契约与日历配置详见 [Agent 调度与日历联动](AGENT_DISPATCH.zh-CN.md)。新增 9 个按角色与 scope 保护的工具,零参 `task_inbox()` 自动注入目录上下文;下述 6 个旧工具作为 deprecated 兼容入口保留。
74
+
73
75
  六个工具都要求 `projectId`,并检查当前令牌的工具集合、scope 和按设备划分的项目授权。
74
76
  它们只操作 Server 数据库,不访问 Runner 文件系统,因此允许使用获授权的离线设备,
75
77
  但拒绝已吊销、暂停或未知设备。`kanban_list_tasks` 要求 `read`,其余看板工具要求
@@ -83,9 +85,8 @@ Runner 优先使用 `HOMEAGENT_WORKSPACE` 指定的记忆工作区;否则,
83
85
  返回路径重叠提醒。
84
86
  - `kanban_update_task(taskId,actualPaths?,message?)`:合并上报路径、添加进度消息并续租。
85
87
  - `kanban_submit_review(taskId,proposedCommitMessage,aiSummary="",fileHashes={})`:
86
- 保存审核证据并进入审核;不要求审核的任务直接完成。
87
- - `kanban_complete_task(taskId,skipReview=false)`:完成审核中的任务;显式 `skipReview`
88
- 也允许完成进行中的任务。不会自动创建 Git 提交。
88
+ 保存审核证据并进入审核;仅低风险且不要求审核的任务直接完成。
89
+ - `kanban_complete_task(taskId,skipReview=false)`:仅允许负责人完成低风险且不要求审核的任务;`skipReview` 不能绕过风险门控。需审核的工作使用 `task_review` 或管理员审批,不自动创建 Git 提交。
89
90
 
90
91
  活跃工具调用仅为认领身份、设备、项目都匹配且未过期的任务续租。仅有 Runner 心跳
91
92
  不会持续占用无人处理的任务。成功的 `write_file`、`edit_block`、`edit_files`、
@@ -93,6 +94,24 @@ Runner 优先使用 `HOMEAGENT_WORKSPACE` 指定的记忆工作区;否则,
93
94
  预演不会记录。Shell 命令和外部编辑器的变更不自动追踪。这些文件工具命中待审核路径时
94
95
  还会返回辅助性 `reviewWarnings`;这不是强制文件锁,也不独立验证上报的哈希。
95
96
 
97
+ ### Web 项目看板
98
+
99
+ 管理员控制台新增「项目看板」:提供五列看板、列表、项目/设备/客户端筛选、搜索、
100
+ 新建与编辑任务、备注,以及包含交付证据和活动记录的详情抽屉。桌面端可拖拽卡片切换
101
+ 状态;详情中的「移动到…」提供相同操作,供键盘与手机使用。非法流转不会改变任务。
102
+
103
+ 待办或已完成任务进入进行中时,必须选择当前拥有项目写入权限的客户端和设备。
104
+ 此操作只记录负责人,不会唤醒 AI 或执行命令。进行中进入待审核时需填写拟提交信息
105
+ 和交付说明,不会伪造已验证的哈希。待审核进入已完成需确认;进行中直接完成需明确
106
+ 确认跳过审核。释放、退回、继续修改及重新打开需要填写原因。这些操作不会停止
107
+ Runner 进程、回滚文件或创建 Git 提交。
108
+
109
+ 看板可见时每五秒同步。浏览器轮询和备注不会延长工作者租约。所有修改都检查管理员
110
+ 会话、CSRF 和预期任务版本;发生并发更新时返回 `409 conflict`,保留浏览器草稿,
111
+ 由用户显式加载最新版本。不可用项目的历史仍可查看;创建/编辑和分配执行需要有效
112
+ 项目配置。页面明确标注路径、消息及哈希历史的截断,区分客户端上报与独立验证。
113
+ 审核失效提示只覆盖内置文件工具确认的修改,不覆盖任意 Shell 命令或外部编辑器。
114
+
96
115
  ## LSP 与代码智能工具
97
116
 
98
117
  - `lsp_document_symbols(path)`:提取源文件结构化符号(类、接口、类型、枚举、函数、方法、常量、变量等)、精确行列范围、文档注释与模块导入关系。
@@ -2,7 +2,7 @@
2
2
 
3
3
  **English** · [简体中文](VALIDATION.zh-CN.md)
4
4
 
5
- This file is a chronological verification record. Historical per-version counts, dates, environments and conclusions are preserved as written; the current release is v0.4.20.
5
+ This file is a chronological verification record. Historical per-version counts, dates, environments and conclusions are preserved as written; the current release is v0.5.0.
6
6
 
7
7
  Date: 2026-10-27. Tests use temporary directories, temporary credentials and the project's own MCP SDK client, never real project keys.
8
8
 
@@ -165,9 +165,28 @@ Environment: Docker Engine **29.8.2**, Compose **5.6.0**, test container Node.js
165
165
 
166
166
  The first manual probe of a non-default mapped port used a Host different from `PUBLIC_URL` and returned 403 by config; using `PUBLIC_URL`'s `localhost` passed. This is the expected Host boundary; the reverse proxy must preserve the configured domain.
167
167
 
168
+ ## v0.5.0 Agent Dispatch and Calendar Integration
169
+
170
+ 2026-11-27, local Windows verification passed: type checking, build, **224/224 tests**,
171
+ 0 failed, 0 skipped, and release inventory checks. Dependency notices match the lockfile.
172
+ The production audit passes the high-severity threshold; two moderate upstream
173
+ dependency findings remain in the existing pinned dependency tree.
174
+
175
+ The suite covers directory-free PAT/OAuth supervisors, role/scope and workspace
176
+ intersection checks, ownership/revision/lease fencing, blocked-task temporary grants,
177
+ high-risk/stale-evidence review gates, bounded inbox histories and Google/CalDAV
178
+ adapter failures. A real protocol-v2 Runner completes the dispatch/inbox/claim/note/
179
+ submit/review flow. A separate wire-schema regression validates forwarded Principal
180
+ scopes against the four-value v0.4.21 enum, ensuring server-only task/calendar scopes
181
+ never invalidate older Runner call frames.
182
+
183
+ Calendar providers use mocked responses; no real personal calendar account was
184
+ connected. This section records local verification; tagged Linux, Windows, Docker
185
+ and package-publication results are provided by the release workflow.
186
+
168
187
  ## Acceptance Still Outstanding
169
188
 
170
- The repository now provides Linux/Windows CI and Docker build / Compose health-check workflows (`.github/workflows/ci.yml` and `release.yml`) with push/PR triggers, plus source archives and npm tarballs up to v0.4.20 under `release/`. However, the following environment acceptance is still outstanding:
189
+ The repository now provides Linux/Windows CI and Docker build / Compose health-check workflows (`.github/workflows/ci.yml` and `release.yml`) with push/PR triggers, plus source archives and npm tarballs up to v0.4.21 under `release/`. However, the following environment acceptance is still outstanding:
171
190
 
172
191
  - No interactive acceptance was performed with a real ChatGPT, Claude or Cursor account. Client docs reference official guides found on 2026-10-26; the protocol and OAuth chain use real SDK and HTTP/WS automated tests.
173
192
  - Linux systemd and Windows Task Scheduler install/uninstall and reboot persistence have not been executed, to avoid modifying login tasks and services on test or development machines.
@@ -2,7 +2,7 @@
2
2
 
3
3
  [English](VALIDATION.md) · **简体中文**
4
4
 
5
- 本文件是按时间顺序的验证记录。各历史版本的计数、日期、环境与结论均按原文保留;当前发布版本为 v0.4.20。
5
+ 本文件是按时间顺序的验证记录。各历史版本的计数、日期、环境与结论均按原文保留;当前发布版本为 v0.5.0。
6
6
 
7
7
  日期:2026-10-27。测试使用临时目录、临时凭据和项目自己的 MCP SDK 客户端,不使用真实项目密钥。
8
8
 
@@ -165,9 +165,24 @@ v0.1 的 14 组测试覆盖:
165
165
 
166
166
  非默认映射端口的第一次手动探测使用了与 PUBLIC_URL 不同的 Host,按配置返回 403;使用 PUBLIC_URL 的 `localhost` 后通过。这是预期 Host 边界,反代必须保留配置域名。
167
167
 
168
+ ## v0.5.0 Agent 调度与日历联动
169
+
170
+ 2026-11-27,本地 Windows 验证通过:类型检查、构建、**224/224 测试**、0 失败、
171
+ 0 跳过及发布文件清单检查。依赖许可证声明与锁文件一致。生产依赖 audit 通过 high
172
+ 级别门槛;现有锁定依赖树中仍有两个来自上游依赖的 moderate 问题。
173
+
174
+ 测试覆盖无目录 PAT/OAuth 主管、角色/scope 与目录交集、负责人/revision/租约隔离、
175
+ 阻塞任务临时授权、高风险及证据过期审批门控、收件箱历史大小边界和 Google/CalDAV
176
+ 失败处理。真实协议 v2 Runner 跑通派单/收件箱/认领/笔记/提审/批准链路;另有
177
+ 独立线协议回归按 v0.4.21 的四值枚举校验转发 Principal,确保任务/日历 scope 不会
178
+ 使旧 Runner 的调用消息失效。
179
+
180
+ 日历 Provider 使用模拟响应,未连接真实个人日历账户。本节仅记录本地验证;标签对应的
181
+ Linux、Windows、Docker 与包发布结果由发布工作流提供。
182
+
168
183
  ## 尚未进行的环境验收
169
184
 
170
- 仓库现已提供 Linux/Windows CI 与 Docker 构建/Compose 健康检查工作流(`.github/workflows/ci.yml` 与 `release.yml`,带 push/PR 触发),`release/` 下也已有截至 v0.4.20 的源码归档和 npm tgz。但以下环境验收仍未完成:
185
+ 仓库现已提供 Linux/Windows CI 与 Docker 构建/Compose 健康检查工作流(`.github/workflows/ci.yml` 与 `release.yml`,带 push/PR 触发),`release/` 下也已有截至 v0.4.21 的源码归档和 npm tgz。但以下环境验收仍未完成:
171
186
 
172
187
  - 没有登录真实 ChatGPT、Claude 或 Cursor 账户做交互验收。客户端文档引用 2026-10-26 查到的官方指南;协议与 OAuth 链路使用真实 SDK 和 HTTP/WS 自动化测试。
173
188
  - Linux systemd、Windows Task Scheduler 的安装/卸载与重启持久性未执行,以免修改测试机或开发机的登录任务和服务。
package/package.json CHANGED
@@ -43,5 +43,5 @@
43
43
  "ws": "8.22.0",
44
44
  "zod": "4.6.7"
45
45
  },
46
- "version": "0.4.20"
46
+ "version": "0.5.0"
47
47
  }