homeagent-runner 0.4.15 → 0.4.16
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 +16 -0
- package/README.en.md +8 -1
- package/README.md +3 -1
- package/dist/runner/permissions.js +24 -11
- package/dist/shared/protocol.js +1 -1
- package/docs/OPEN_SOURCE.md +8 -8
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.4.16 — Consistent project identity and permissions
|
|
4
|
+
|
|
5
|
+
- Give newly added projects random IDs and persist per-device identity history;
|
|
6
|
+
reject reuse of removed IDs so new projects cannot inherit old explicit grants.
|
|
7
|
+
Preserve existing project IDs, names and permissions, including legacy grants.
|
|
8
|
+
- Separate saved project identity and client authorization from Runner availability.
|
|
9
|
+
Keep explicit selections for temporarily hidden, pending, failed or removed projects
|
|
10
|
+
when editing other permissions, without making unavailable projects accessible.
|
|
11
|
+
- Fence temporary-policy expiration inside the serialized permission queue so an old
|
|
12
|
+
expiration cannot clear a newer applied policy or overwrite its application status.
|
|
13
|
+
- Allow an optional project name during pairing, derive unnamed projects from their
|
|
14
|
+
directory, and show an empty project list instead of inserting a Workspace placeholder.
|
|
15
|
+
- Record multi-project Assist termination as a session-level audit event.
|
|
16
|
+
- Add project identity, grant retention, pairing-name and deterministic expiry-race
|
|
17
|
+
regressions; verify the changed Dashboard and MCP access in an isolated live setup.
|
|
18
|
+
|
|
3
19
|
## 0.4.15 — Remote Assist release verification
|
|
4
20
|
|
|
5
21
|
- Fix a cross-platform test race by waiting for the Server's disconnect cleanup
|
package/README.en.md
CHANGED
|
@@ -193,7 +193,7 @@ Even before login, the full-screen welcome page explains that the device is not
|
|
|
193
193
|
signed in. Press Enter to provide the Web URL and device name and create the
|
|
194
194
|
private `$HOME/.homeagent/runner.json`. Press `o` on the approval screen to open
|
|
195
195
|
the browser; the link is valid for 10 minutes. Confirm the device name and project
|
|
196
|
-
directory in your signed-in browser. After approval, the Runner connects
|
|
196
|
+
directory and optional project name in your signed-in browser. After approval, the Runner connects
|
|
197
197
|
automatically. You can also add projects later in the Dashboard.
|
|
198
198
|
|
|
199
199
|
**The Server stores project directories and permissions.** New local Runner
|
|
@@ -202,6 +202,13 @@ credentials and job state. Until you configure a project, no project access is
|
|
|
202
202
|
available. The first project setting is permanent by default; temporary access
|
|
203
203
|
remains available in the permission editor.
|
|
204
204
|
|
|
205
|
+
There is no separate default directory: an existing `Workspace` is an ordinary
|
|
206
|
+
project and can be renamed. Editing a project preserves its ID and grants;
|
|
207
|
+
new projects use fresh IDs, and removed IDs cannot be reused. Client permission
|
|
208
|
+
editing preserves explicit grants for temporarily unavailable, pending or failed
|
|
209
|
+
projects and labels their status until you deselect them. This does not make
|
|
210
|
+
unavailable projects accessible.
|
|
211
|
+
|
|
205
212
|
```sh
|
|
206
213
|
# Use the same entry point next time; login is detected automatically:
|
|
207
214
|
homeagent
|
package/README.md
CHANGED
|
@@ -168,10 +168,12 @@ npm install -g homeagent-runner@latest
|
|
|
168
168
|
homeagent
|
|
169
169
|
```
|
|
170
170
|
|
|
171
|
-
未登录时也会进入全屏欢迎页,提示“尚未登录”。按 Enter 填写 Web URL 和设备名称,自动生成 `$HOME/.homeagent/runner.json`;等待批准时按 `o` 打开浏览器登录页面,链接有效期为 10
|
|
171
|
+
未登录时也会进入全屏欢迎页,提示“尚未登录”。按 Enter 填写 Web URL 和设备名称,自动生成 `$HOME/.homeagent/runner.json`;等待批准时按 `o` 打开浏览器登录页面,链接有效期为 10 分钟。在网页中核对设备名称、填写被控端的项目名称和目录并批准后,Runner 自动开始连接。也可以稍后在 Dashboard 的“管理设备权限”中添加项目。
|
|
172
172
|
|
|
173
173
|
**项目目录和权限只由 Server 保存**,本地配置不接受 `projects/root`。本地 `stateDir` 仅用于保存设备凭据和任务状态,不是项目目录。未配置项目时,Runner 不开放任何项目访问。首次项目设置默认永久保存;临时开放可在权限编辑器中另外选择。
|
|
174
174
|
|
|
175
|
+
项目没有独立的默认目录:旧 `Workspace` 也是普通项目,可修改名称。修改已有项目保留 ID 与授权;删除后新增使用新的 ID,已移除 ID 不能复用。临时未开放、待应用或应用失败的项目会在客户端权限编辑器中标明状态,原有明确项目授权保留,直到主动取消;这不会让暂不可用项目获得执行访问。
|
|
176
|
+
|
|
175
177
|
```sh
|
|
176
178
|
# 以后仍使用同一个入口,自动检查登录并连接:
|
|
177
179
|
homeagent
|
|
@@ -31,6 +31,11 @@ export class RunnerPermissions {
|
|
|
31
31
|
this.consent?.validatePermissions(policy);
|
|
32
32
|
if (policy.revision < this.revision)
|
|
33
33
|
throw new AppError('stale_permissions', 'Refusing an older device permission revision');
|
|
34
|
+
// Retire the old expiration before invalidation or task shutdown can yield.
|
|
35
|
+
if (this.timer)
|
|
36
|
+
clearTimeout(this.timer);
|
|
37
|
+
this.timer = undefined;
|
|
38
|
+
this.current = undefined;
|
|
34
39
|
const expired = !!policy.expiresAt && policy.expiresAt <= Date.now();
|
|
35
40
|
const selected = expired ? policy.fallbackProjects : policy.projects;
|
|
36
41
|
// A policy that fails validation must still stop the previous authority.
|
|
@@ -38,7 +43,6 @@ export class RunnerPermissions {
|
|
|
38
43
|
await this.tools.processes.stopAllAndWait();
|
|
39
44
|
this.config.projects = [];
|
|
40
45
|
this.tools.policy.expiresAt = undefined;
|
|
41
|
-
this.current = undefined;
|
|
42
46
|
const projects = [];
|
|
43
47
|
for (const project of selected) {
|
|
44
48
|
if (!path.isAbsolute(project.root))
|
|
@@ -54,8 +58,6 @@ export class RunnerPermissions {
|
|
|
54
58
|
}
|
|
55
59
|
if (new Set(projects.map(project => project.id)).size !== projects.length)
|
|
56
60
|
throw new AppError('duplicate_project', 'Project IDs must be unique');
|
|
57
|
-
if (this.timer)
|
|
58
|
-
clearTimeout(this.timer);
|
|
59
61
|
this.revision = policy.revision;
|
|
60
62
|
this.current = policy;
|
|
61
63
|
this.config.projects = projects;
|
|
@@ -69,14 +71,25 @@ export class RunnerPermissions {
|
|
|
69
71
|
}
|
|
70
72
|
if (!expired && policy.expiresAt)
|
|
71
73
|
this.timer = setTimeout(() => {
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
74
|
+
const next = this.queue.catch(() => { }).then(async () => {
|
|
75
|
+
// An update may have superseded this policy while expiration was queued.
|
|
76
|
+
if (this.current !== policy)
|
|
77
|
+
return;
|
|
78
|
+
if (this.consent) {
|
|
79
|
+
this.consent.revoke();
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
// Keep revocation and fallback together so an update cannot land between them.
|
|
83
|
+
try {
|
|
84
|
+
await this.resetNow();
|
|
85
|
+
await this.applyNow({ revision: policy.revision, projects: policy.fallbackProjects, expiresAt: null, fallbackProjects: policy.fallbackProjects });
|
|
86
|
+
this.changed(policy.revision);
|
|
87
|
+
}
|
|
88
|
+
catch (error) {
|
|
89
|
+
this.changed(policy.revision, error instanceof Error ? error.message : 'Permission expiration failed');
|
|
90
|
+
}
|
|
91
|
+
});
|
|
92
|
+
this.queue = next;
|
|
80
93
|
}, Math.max(1, policy.expiresAt - Date.now())).unref();
|
|
81
94
|
}
|
|
82
95
|
reset() {
|
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.16';
|
|
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/docs/OPEN_SOURCE.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# 开源仓库与源码发布
|
|
2
2
|
|
|
3
|
-
本仓库以 MIT 开放原始代码,版本为 0.4.
|
|
3
|
+
本仓库以 MIT 开放原始代码,版本为 0.4.16,npm 发布拆成 `homeagent-server` 和 `homeagent-runner` 两个包。Server 包只包含编译后的 Server、Dashboard 和 Server 资源;Runner 包只包含 Runner、共享协议和 Windows 进程树辅助代码。CLI 和源码采用相同许可证;两个 npm 包都通过文件白名单只包含运行所需文件、文档和许可证。包名是否可用及账号发布权限以发布当时的 registry 为准。
|
|
4
4
|
|
|
5
5
|
## 文件划分
|
|
6
6
|
|
|
@@ -53,7 +53,7 @@ npm run release:source
|
|
|
53
53
|
|
|
54
54
|
输出位于被忽略的 release/:
|
|
55
55
|
|
|
56
|
-
- `HomeAgent-v0.4.
|
|
56
|
+
- `HomeAgent-v0.4.16-source.tar.gz`
|
|
57
57
|
- 对应 `.sha256` 校验文件
|
|
58
58
|
- 对应 `.manifest.txt`,包括版本、Git 提交和全部发布路径
|
|
59
59
|
|
|
@@ -65,8 +65,8 @@ npm run release:source
|
|
|
65
65
|
|
|
66
66
|
`npm run release:npm` 构建 JavaScript、以 `--ignore-scripts` 分别打包两个包,并检查归档文件白名单、运行资源及 SHA-512 完整性,输出:
|
|
67
67
|
|
|
68
|
-
- `release/homeagent-server-0.4.
|
|
69
|
-
- `release/homeagent-runner-0.4.
|
|
68
|
+
- `release/homeagent-server-0.4.16.tgz`
|
|
69
|
+
- `release/homeagent-runner-0.4.16.tgz`
|
|
70
70
|
- 两个归档各自的 `.sha256`
|
|
71
71
|
- `release/npm-packages.json`:两个包的名称、版本、Git commit、校验、dist-tag 和路径清单
|
|
72
72
|
|
|
@@ -76,20 +76,20 @@ npm run release:source
|
|
|
76
76
|
|
|
77
77
|
`.github/workflows/release.yml` 支持两种入口:
|
|
78
78
|
|
|
79
|
-
1. 推送版本标签,例如 `v0.4.
|
|
79
|
+
1. 推送版本标签,例如 `v0.4.16`。
|
|
80
80
|
2. 在 Actions → release → Run workflow 中填写**已经存在**的版本标签。
|
|
81
81
|
|
|
82
82
|
先按下一节配置 `NPM_TOKEN`。首次推送源码、配置真实 `origin` 并确认 Actions 可用后,可以按下面方式发布:
|
|
83
83
|
|
|
84
84
|
```sh
|
|
85
85
|
# 先提交本次版本的源码和文档,工作区保持干净
|
|
86
|
-
git tag -a v0.4.
|
|
87
|
-
git push origin v0.4.
|
|
86
|
+
git tag -a v0.4.16 -m "HomeAgent v0.4.16"
|
|
87
|
+
git push origin v0.4.16
|
|
88
88
|
```
|
|
89
89
|
|
|
90
90
|
本文只是发布说明,准备脚本不会替操作者执行这些命令。
|
|
91
91
|
|
|
92
|
-
标签必须与 package.json、package-lock.json 及 runtime VERSION 一致,CHANGELOG.md 必须有对应版本的非空条目。预发布可用 `v0.4.
|
|
92
|
+
标签必须与 package.json、package-lock.json 及 runtime VERSION 一致,CHANGELOG.md 必须有对应版本的非空条目。预发布可用 `v0.4.16-rc.1`(相关版本文件也必须为 `0.4.16-rc.1`)。禁止把普通分支或不匹配版本伪装成发布。
|
|
93
93
|
|
|
94
94
|
发布流水线按次序执行:
|
|
95
95
|
|
package/package.json
CHANGED