ai-coding-agent-linux-x64 0.3.30 → 0.3.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +16 -8
- package/bin/ai-coding-agent +0 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -7,12 +7,12 @@
|
|
|
7
7
|
正式发布后,用户只需:
|
|
8
8
|
|
|
9
9
|
```sh
|
|
10
|
-
npm install -g ai-coding-agent
|
|
10
|
+
npm install -g @soulock/ai-coding-agent
|
|
11
11
|
```
|
|
12
12
|
|
|
13
13
|
npm 会下载当前操作系统和 CPU 对应的 Go 二进制,并在 `postinstall` 阶段自动运行 `ai-coding-agent install`。如果 npm 使用了 `--ignore-scripts`,需再手动执行一次 `ai-coding-agent install`。
|
|
14
14
|
|
|
15
|
-
执行 `npm uninstall -g ai-coding-agent` 时会自动移除 Agent 自己安装的 Hook、配置和数据,并恢复安装前的 `core.hooksPath`。
|
|
15
|
+
执行 `npm uninstall -g @soulock/ai-coding-agent` 时会自动移除 Agent 自己安装的 Hook、配置和数据,并恢复安装前的 `core.hooksPath`。
|
|
16
16
|
|
|
17
17
|
发布者先生成六个平台包:
|
|
18
18
|
|
|
@@ -30,12 +30,20 @@ npm run build:npm
|
|
|
30
30
|
go build -o ai-coding-agent ./cmd/agent
|
|
31
31
|
./ai-coding-agent install
|
|
32
32
|
./ai-coding-agent status
|
|
33
|
-
./ai-coding-agent
|
|
34
|
-
./ai-coding-agent
|
|
35
|
-
./ai-coding-agent
|
|
33
|
+
./ai-coding-agent event commit # Hook 使用:只写本地事件并唤醒 daemon
|
|
34
|
+
./ai-coding-agent event pull
|
|
35
|
+
./ai-coding-agent event push
|
|
36
|
+
./ai-coding-agent collect commit # 兼容旧 Hook,同样只写事件
|
|
37
|
+
./ai-coding-agent daemon --once # 执行一轮后台维护后退出
|
|
36
38
|
./ai-coding-agent uninstall
|
|
37
39
|
```
|
|
38
40
|
|
|
41
|
+
安装成功后客户端会自动启动一个单实例 `daemon`。Git Hook 只把事件原子写入 `data/events/`,记录当时的仓库根目录和 commit SHA,然后唤醒 daemon;Hook 内不执行依赖安装、数据采集或网络请求。daemon 按事件文件顺序执行采集,失败事件保留且不会被后续事件越过;损坏事件移入 `data/events/dead-letter/`。
|
|
42
|
+
|
|
43
|
+
daemon 每 5 分钟重放上传队列、增量同步 sessions 和 client.log,并在最后检查客户端更新;新 Hook 事件会立即唤醒它,无需等待周期。每次 Hook 也会检查 daemon 原生进程锁,未运行时自动拉起。更新成功后旧进程释放单实例锁,再启动更新后的 daemon。daemon 异常退出时内核会立即释放锁,不会阻断 Git 提交;下一次 Hook、安装流程或手工执行 `ai-coding-agent daemon` 会恢复维护。
|
|
44
|
+
|
|
45
|
+
自动更新先校验 SHA-256 并备份当前版本。Windows 因运行中的 `.exe` 不能覆盖自身,会启动位于暂存目录的独立 updater,等待旧 daemon 退出后替换并拉起新版;macOS 的原子替换失败时也使用同一兜底。替换失败会恢复备份并保留暂存文件,后续 Hook/daemon 自动重试,无需重新安装。
|
|
46
|
+
|
|
39
47
|
配置中的 `endpoint` 键已废弃并被忽略(服务器地址编译在二进制中,当前为 `http://192.168.110.120:8080`,改地址需修改代码重新发版);`config.yaml` 只保存身份与超时(Windows 为 `%LOCALAPPDATA%\\ai-coding-agent\\config.yaml`)。上报失败的数据会保存到 `data/queue`,下次采集时重放;详见下文「上报」。
|
|
40
48
|
|
|
41
49
|
构建目标示例:
|
|
@@ -46,15 +54,15 @@ GOOS=windows GOARCH=amd64 go build -o dist/ai-coding-agent-windows-amd64.exe ./c
|
|
|
46
54
|
GOOS=linux GOARCH=arm64 go build -o dist/ai-coding-agent-linux-arm64 ./cmd/agent
|
|
47
55
|
```
|
|
48
56
|
|
|
49
|
-
Hook
|
|
57
|
+
Hook 只负责调用 Agent 写入本地事件;所有采集和 HTTP 逻辑均由后台 daemon 执行。
|
|
50
58
|
|
|
51
59
|
Git 数据包含 `repository_url`。HTTPS/SSH 地址会移除用户名、密码、Token、查询参数和 fragment 后再上报;本地仓库磁盘路径不会上传。
|
|
52
60
|
|
|
53
|
-
`post-commit`、`post-merge`、`pre-push` 都使用 Git 自带的 POSIX shell 执行,兼容 macOS、Linux 和 Windows Git for Windows。Windows 安装路径会转换为 Git Bash 的 `/c/...` 格式;Hook 使用 LF
|
|
61
|
+
`post-commit`、`post-merge`、`pre-push` 都使用 Git 自带的 POSIX shell 执行,兼容 macOS、Linux 和 Windows Git for Windows。Windows 安装路径会转换为 Git Bash 的 `/c/...` 格式;Hook 使用 LF 换行,同步完成一次轻量事件落盘后立即返回,并始终忽略 Agent 错误,确保不影响 Git 操作。
|
|
54
62
|
|
|
55
63
|
## 上报
|
|
56
64
|
|
|
57
|
-
post-commit / post-merge / pre-push 钩子触发 `ai-coding-agent
|
|
65
|
+
post-commit / post-merge / pre-push 钩子触发 `ai-coding-agent event <type>` 写入事件,daemon 消费事件后向 git-ai-server 上报:
|
|
58
66
|
|
|
59
67
|
| 端点 | 触发 | 内容 |
|
|
60
68
|
|---|---|---|
|
package/bin/ai-coding-agent
CHANGED
|
Binary file
|