git-ai-control 0.4.9 → 0.4.11
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 +18 -0
- package/README.md +165 -2
- package/README.zh-CN.md +170 -0
- package/package.json +2 -1
- package/server.py +13 -0
- package/static/assets/index-CllegGOU.js +50 -0
- package/static/assets/index-Dx-rnRk7.css +2 -0
- package/static/index.html +2 -2
- package/static/assets/index-CpOHU4DS.css +0 -2
- package/static/assets/index-t5Osu3Sa.js +0 -50
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,24 @@
|
|
|
2
2
|
|
|
3
3
|
本项目的所有重要变更都会记录在此文件中。
|
|
4
4
|
|
|
5
|
+
## [0.4.11] - 2026-08-12
|
|
6
|
+
|
|
7
|
+
### 修复
|
|
8
|
+
|
|
9
|
+
- 将配置中心的构建时间固化为随版本提交的元数据,确保本地与发布流水线生成一致的静态资源。
|
|
10
|
+
|
|
11
|
+
## [0.4.10] - 2026-08-12
|
|
12
|
+
|
|
13
|
+
### 新增
|
|
14
|
+
|
|
15
|
+
- 配置中心支持中文与英文:首次按系统语言显示,右上角可手动切换并记住选择;状态、设置、插件、审计、验证提示和日期格式均随语言更新。
|
|
16
|
+
- `README.md` 改为英文默认文档,并新增 `README.zh-CN.md` 中文文档入口。
|
|
17
|
+
- Git AI 状态卡展示 Git AI 二进制版本与更新时间;过滤服务状态卡展示 git-ai-control 版本与构建更新时间。
|
|
18
|
+
|
|
19
|
+
### 变更
|
|
20
|
+
|
|
21
|
+
- 状态卡中的版本号调整为紧随“已开启 / 已在线”状态文本,缩短信息阅读距离。
|
|
22
|
+
|
|
5
23
|
## [0.4.9] - 2026-08-12
|
|
6
24
|
|
|
7
25
|
### 修复
|
package/README.md
CHANGED
|
@@ -1,8 +1,171 @@
|
|
|
1
1
|
# Git AI Control Panel
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[中文文档](README.zh-CN.md)
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Git AI Control Panel is a local settings and upload-policy manager for Git AI on macOS, Linux, and Windows. It lets you control report event types and fields by repository host without manually editing JSON or writing a script for every privacy rule. The React/Vite control page listens only on `127.0.0.1:38742`; it is never exposed to your LAN or the public internet.
|
|
6
|
+
|
|
7
|
+
> [!IMPORTANT]
|
|
8
|
+
> The project detects both custom `custom_metrics` builds and the upstream [`git-ai-project/git-ai`](https://github.com/git-ai-project/git-ai), but their capabilities differ. Repository-level event controls, field redaction, and Skill filtering require the `custom_metrics` extension point. Read the [compatibility guide](COMPATIBILITY.md) before installing.
|
|
9
|
+
|
|
10
|
+
## Features
|
|
11
|
+
|
|
12
|
+
- Manage Git AI automatic updates, version checks, repository exclusions, and prompt exclusions.
|
|
13
|
+
- Apply a common policy to GitHub, GitLab, Gitee, or another Git host.
|
|
14
|
+
- Control Token, Skills, Commit, Checkpoint, Agent, prompt-duration, and prompt-report uploads independently.
|
|
15
|
+
- Remove repository, project-path, and branch fields before a report leaves the device.
|
|
16
|
+
- Replace the reporting directory for allowed Skill uploads with a fixed directory.
|
|
17
|
+
- Block Skills by keyword or regular expression.
|
|
18
|
+
- Add repository plugins with a global fallback plus repository, directory, branch, and priority matching.
|
|
19
|
+
- Redact or block sensitive content such as API keys, private keys, and credentials.
|
|
20
|
+
- Govern Agent and model usage with allowlists, regex rules, audit mode, or blocking mode.
|
|
21
|
+
- Review the last 24 hours of locally blocked reports without storing report bodies.
|
|
22
|
+
- Show Git AI and filter-service status, version, and update time.
|
|
23
|
+
|
|
24
|
+
## Screenshots
|
|
25
|
+
|
|
26
|
+
### Native Git AI settings
|
|
27
|
+
|
|
28
|
+

|
|
29
|
+
|
|
30
|
+
### Plugin management
|
|
31
|
+
|
|
32
|
+

|
|
33
|
+
|
|
34
|
+
## Quick start
|
|
35
|
+
|
|
36
|
+
### 1. Run one command
|
|
37
|
+
|
|
38
|
+
macOS, Linux, and Windows are supported. You need Node.js 18+, Python 3, and Git AI installed in its default location:
|
|
39
|
+
|
|
40
|
+
```text
|
|
41
|
+
macOS / Linux: ~/.git-ai/bin/git-ai
|
|
42
|
+
Windows: %USERPROFILE%\.git-ai\bin\git-ai.exe
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
Then run:
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
npx git-ai-control
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
The first run downloads the latest version, installs local services, and opens the control center. Later runs reuse the active local control center when it is already running. If the browser does not open automatically, visit:
|
|
52
|
+
|
|
53
|
+
```text
|
|
54
|
+
http://127.0.0.1:38742
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
The installer detects whether Git AI supports `custom_metrics`, backs up original reporting endpoints for the current user only, keeps existing `config.json` and `filter_plugins.json`, installs the control page and filter runtime, and waits for both local health checks.
|
|
58
|
+
|
|
59
|
+
| OS | Service manager | Requirement |
|
|
60
|
+
| --- | --- | --- |
|
|
61
|
+
| macOS | LaunchAgent | Current graphical user session |
|
|
62
|
+
| Linux | systemd user | Available systemd user session |
|
|
63
|
+
| Windows | Task Scheduler | Current user can create a logon task |
|
|
64
|
+
|
|
65
|
+
### 2. Configure a repository policy
|
|
66
|
+
|
|
67
|
+
For example, to allow only Token uploads for private GitHub repositories:
|
|
68
|
+
|
|
69
|
+
1. Add or open a repository plugin.
|
|
70
|
+
2. Enter `github.com` under **Matching repository hosts**.
|
|
71
|
+
3. Enable **Token** only; disable Skills, Commit, Checkpoint, Agent, prompt duration, and prompt reports.
|
|
72
|
+
4. Disable repository information, project path, and branch name.
|
|
73
|
+
5. Save changes.
|
|
74
|
+
|
|
75
|
+
Specific rules are matched before the global **All repositories** rule. Higher priorities win; equal priorities follow plugin list order. Repository, directory, and branch conditions must all match when populated.
|
|
76
|
+
|
|
77
|
+
### 3. Configure sensitive-content and Agent/model protection
|
|
78
|
+
|
|
79
|
+
From **Plugin management**, add either of these independent plugins:
|
|
80
|
+
|
|
81
|
+
1. **Sensitive data redaction** — select event types, built-in rules, and custom regex; then redact or block matching reports.
|
|
82
|
+
2. **Agent / model governance** — configure allowed Agents, models, and blocking regex. Start with audit mode, then use blocking mode if appropriate.
|
|
83
|
+
|
|
84
|
+
### 4. Configure Skill filtering
|
|
85
|
+
|
|
86
|
+
1. Add the **Skill filter plugin**.
|
|
87
|
+
2. Enable it.
|
|
88
|
+
3. Enter one keyword or regular expression per line.
|
|
89
|
+
4. Save changes.
|
|
90
|
+
|
|
91
|
+
### 5. Verify local services
|
|
92
|
+
|
|
93
|
+
Use **Validate settings** in the page, or run:
|
|
94
|
+
|
|
95
|
+
```bash
|
|
96
|
+
curl -fsS http://127.0.0.1:38742/api/status
|
|
97
|
+
curl -fsS http://127.0.0.1:38741/health
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
## How it works
|
|
101
|
+
|
|
102
|
+
The project does not modify the `~/.git-ai/bin/git-ai` binary. When the `custom_metrics` extension point is available, the installer redirects Git AI custom reporting endpoints to the local filter service:
|
|
103
|
+
|
|
104
|
+
```text
|
|
105
|
+
Git AI
|
|
106
|
+
-> ~/.git-ai/custom_metrics.json
|
|
107
|
+
-> http://127.0.0.1:38741
|
|
108
|
+
-> reads ~/.git-ai/filter_plugins.json
|
|
109
|
+
-> reads ~/.git-ai/upstream_metrics.json
|
|
110
|
+
-> blocks, or redacts and forwards to the original reporting service
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
Saving from the control page only updates:
|
|
114
|
+
|
|
115
|
+
- `~/.git-ai/config.json` — native Git AI settings;
|
|
116
|
+
- `~/.git-ai/filter_plugins.json` — repository and Skill filter policies.
|
|
117
|
+
|
|
118
|
+
The filter runtime is installed from `plugins/upload-filter/plugin_filter_runtime.py`. The page does not generate or modify the Python runtime; `~/.git-ai` contains only the installed copy and user configuration.
|
|
119
|
+
|
|
120
|
+
## Files
|
|
121
|
+
|
|
122
|
+
| Item | Location |
|
|
123
|
+
| --- | --- |
|
|
124
|
+
| Filter runtime source | `plugins/upload-filter/plugin_filter_runtime.py` |
|
|
125
|
+
| Cross-platform installer | `scripts/install.mjs`, `scripts/uninstall.mjs` |
|
|
126
|
+
| Service adapters | `scripts/platform-services.mjs` |
|
|
127
|
+
| Native Git AI configuration | `~/.git-ai/config.json` |
|
|
128
|
+
| Plugin policy | `~/.git-ai/filter_plugins.json` |
|
|
129
|
+
| Original reporting-endpoint backup | `~/.git-ai/upstream_metrics.json` |
|
|
130
|
+
| Installed filter runtime | `~/.git-ai/filters/plugin_filter_runtime.py` |
|
|
131
|
+
| Installed control page | `~/.git-ai/control-panel` |
|
|
132
|
+
|
|
133
|
+
## Uninstall
|
|
134
|
+
|
|
135
|
+
```bash
|
|
136
|
+
npx git-ai-control uninstall
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
Uninstall stops the two services, removes this project's installed runtime copies, and restores the original Git AI reporting endpoints. It keeps `config.json`, `filter_plugins.json`, and logs.
|
|
140
|
+
|
|
141
|
+
## Contributing
|
|
142
|
+
|
|
143
|
+
Contributions are welcome, especially compatibility verification for different Git AI versions, independent plugin types, test coverage, documentation, interaction, and accessibility improvements.
|
|
144
|
+
|
|
145
|
+
```bash
|
|
146
|
+
cd frontend/git-ai-control-panel
|
|
147
|
+
npm ci
|
|
148
|
+
npm run lint
|
|
149
|
+
npm run build
|
|
150
|
+
cd ../..
|
|
151
|
+
npm run check
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
When opening a pull request, explain the scenario, configuration or filtering impact, validation commands, and include before/after screenshots for UI changes.
|
|
155
|
+
|
|
156
|
+
## Releases
|
|
157
|
+
|
|
158
|
+
The project publishes one cross-platform npm package. Pushing a Git tag matching the `package.json` version triggers GitHub Actions to validate macOS, Ubuntu, and Windows, build the frontend once, verify committed static assets, and publish to npm through Trusted Publishing (OIDC).
|
|
159
|
+
|
|
160
|
+
## Security boundaries
|
|
161
|
+
|
|
162
|
+
- The web service binds only to loopback.
|
|
163
|
+
- Git AI API keys and other sensitive fields are not read or shown.
|
|
164
|
+
- Original reporting endpoints are never committed to source; they are stored only in a local user configuration with `0600` permissions.
|
|
165
|
+
- Saves use temporary-file replacement to avoid partial configuration writes.
|
|
166
|
+
- The page rejects modification requests from non-page origins.
|
|
167
|
+
- If plugin configuration is missing or invalid, the default GitHub policy remains fully blocking.
|
|
168
|
+
- Without the granular filtering extension point, the page reports native-settings compatibility instead of claiming filtering is active.
|
|
6
169
|
|
|
7
170
|
> [!IMPORTANT]
|
|
8
171
|
> 项目可以识别 `custom_metrics` 定制版和官方 [`git-ai-project/git-ai`](https://github.com/git-ai-project/git-ai),但两者支持层级不同。仓库级事件开关、字段脱敏和 Skill 过滤目前需要 `custom_metrics` 扩展点;官方版只能管理 Git AI 已公开的原生配置。安装前请阅读[兼容性说明](COMPATIBILITY.md)。
|
package/README.zh-CN.md
ADDED
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
# Git AI 配置中心
|
|
2
|
+
|
|
3
|
+
[English documentation](README.md)
|
|
4
|
+
|
|
5
|
+
公司统一安装了 Git AI,但不想让私人 GitHub 项目的仓库名、路径、分支或 Skill 使用情况被上报?可以试试 Git AI 配置中心。
|
|
6
|
+
|
|
7
|
+
它是一个支持 macOS、Linux 和 Windows 的 Git AI 本地配置与上传策略管理页面:不用手改 JSON,也不用为每条隐私规则编写脚本,就能按仓库主机控制允许上传的数据类型和字段。前端使用 React、Vite 与 shadcn/ui,Web 服务只监听 `127.0.0.1:38742`,不会向局域网或公网开放。
|
|
8
|
+
|
|
9
|
+
> [!IMPORTANT]
|
|
10
|
+
> 项目可以识别 `custom_metrics` 定制版和官方 [`git-ai-project/git-ai`](https://github.com/git-ai-project/git-ai),但两者支持层级不同。仓库级事件开关、字段脱敏和 Skill 过滤目前需要 `custom_metrics` 扩展点;官方版只能管理 Git AI 已公开的原生配置。安装前请阅读[兼容性说明](COMPATIBILITY.md)。
|
|
11
|
+
|
|
12
|
+
## 功能
|
|
13
|
+
|
|
14
|
+
- 可视化管理 Git AI 自动更新、版本检查、仓库排除和提示词排除;
|
|
15
|
+
- 通过“匹配仓库主机”统一处理 GitHub、GitLab、Gitee 或其他 Git 服务;
|
|
16
|
+
- 分别控制 Token、Skills、Commit、Checkpoint、Agent、提示耗时和提示报告;
|
|
17
|
+
- 可删除仓库信息、项目路径和分支名称等敏感字段;
|
|
18
|
+
- 可将允许上传的 Skill 项目目录替换为固定目录;
|
|
19
|
+
- 可按关键词或正则拦截指定 Skill;
|
|
20
|
+
- 仓库插件可按不同主机添加多个,并支持全局兜底、仓库、目录、分支与优先级;
|
|
21
|
+
- 敏感内容脱敏插件可识别 API Key、私钥、凭据,并按规则脱敏或拦截;
|
|
22
|
+
- Agent / 模型治理插件支持允许名单、阻止正则及审计/拦截模式;
|
|
23
|
+
- 可查看最近 24 小时的本机拦截记录,且不保存上报正文;
|
|
24
|
+
- 展示 Git AI 与过滤服务的状态、版本和更新时间。
|
|
25
|
+
|
|
26
|
+
## 界面截图
|
|
27
|
+
|
|
28
|
+
### Git AI 原生设置
|
|
29
|
+
|
|
30
|
+

|
|
31
|
+
|
|
32
|
+
### 插件管理
|
|
33
|
+
|
|
34
|
+

|
|
35
|
+
|
|
36
|
+
## 快速开始
|
|
37
|
+
|
|
38
|
+
### 1. 一条命令启动
|
|
39
|
+
|
|
40
|
+
支持 macOS、Linux 和 Windows,需要 Node.js 18+、Python 3,并要求 Git AI 已安装在默认目录:
|
|
41
|
+
|
|
42
|
+
```text
|
|
43
|
+
macOS / Linux: ~/.git-ai/bin/git-ai
|
|
44
|
+
Windows: %USERPROFILE%\.git-ai\bin\git-ai.exe
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
确认文件存在后运行:
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
npx git-ai-control
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
首次运行时,该命令会自动下载最新版本、安装本机服务,并打开 Git AI 配置中心;之后检测到已运行的配置中心时,会直接复用现有进程。若浏览器没有自动打开,可手动访问:
|
|
54
|
+
|
|
55
|
+
```text
|
|
56
|
+
http://127.0.0.1:38742
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
首次安装过程会识别 `custom_metrics` 扩展、备份当前用户的原始上报端点、保留已有的 `config.json` 与 `filter_plugins.json`、安装控制页面和过滤运行时,并等待两个本机服务通过健康检查。
|
|
60
|
+
|
|
61
|
+
| 系统 | 服务管理器 | 使用条件 |
|
|
62
|
+
| --- | --- | --- |
|
|
63
|
+
| macOS | LaunchAgent | 当前图形用户会话 |
|
|
64
|
+
| Linux | systemd user | 可用的 systemd 用户会话 |
|
|
65
|
+
| Windows | 任务计划程序 | 当前用户可创建登录任务 |
|
|
66
|
+
|
|
67
|
+
### 2. 配置仓库插件
|
|
68
|
+
|
|
69
|
+
以“GitHub 私人仓库只允许上传 Token”为例:
|
|
70
|
+
|
|
71
|
+
1. 在“仓库插件”中添加或打开现有仓库插件;
|
|
72
|
+
2. 在“匹配仓库主机”中填写 `github.com`;
|
|
73
|
+
3. 只打开 `Token`,关闭 `Skills`、`Commit`、`Checkpoint`、`Agent`、提示耗时和提示报告;
|
|
74
|
+
4. 关闭“仓库信息”“项目路径”和“分支名称”;
|
|
75
|
+
5. 保存配置。
|
|
76
|
+
|
|
77
|
+
仓库策略会先匹配特定规则,再匹配“全部仓库”全局规则;特定规则之间优先级数字越大越靠前,同优先级按插件列表顺序处理。仓库、目录、分支同时填写时需要全部命中。
|
|
78
|
+
|
|
79
|
+
### 3. 配置敏感内容与 Agent
|
|
80
|
+
|
|
81
|
+
在“插件管理”中可分别添加以下独立插件:
|
|
82
|
+
|
|
83
|
+
1. “敏感内容脱敏”:选择作用事件、内置规则和自定义正则;命中后可脱敏或阻止上报;
|
|
84
|
+
2. “Agent / 模型治理”:配置允许的 Agent、模型与阻止正则;先使用“仅审计”确认命中情况,再按需改为阻止。
|
|
85
|
+
|
|
86
|
+
### 4. 配置 Skill 过滤插件
|
|
87
|
+
|
|
88
|
+
1. 添加“Skill 过滤插件”;
|
|
89
|
+
2. 打开插件;
|
|
90
|
+
3. 每行填写一个关键词或正则;
|
|
91
|
+
4. 保存配置。
|
|
92
|
+
|
|
93
|
+
### 5. 验证配置
|
|
94
|
+
|
|
95
|
+
点击页面中的“验证配置”,或在终端检查两个本机服务:
|
|
96
|
+
|
|
97
|
+
```bash
|
|
98
|
+
curl -fsS http://127.0.0.1:38742/api/status
|
|
99
|
+
curl -fsS http://127.0.0.1:38741/health
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
## 工作方式
|
|
103
|
+
|
|
104
|
+
本项目不会修改 `~/.git-ai/bin/git-ai` 二进制。检测到 `custom_metrics` 扩展点后,安装脚本会将 Git AI 的自定义上报端点指向本机过滤服务:
|
|
105
|
+
|
|
106
|
+
```text
|
|
107
|
+
Git AI
|
|
108
|
+
-> ~/.git-ai/custom_metrics.json
|
|
109
|
+
-> http://127.0.0.1:38741
|
|
110
|
+
-> 读取 ~/.git-ai/filter_plugins.json
|
|
111
|
+
-> 读取 ~/.git-ai/upstream_metrics.json
|
|
112
|
+
-> 拦截,或脱敏后转发至原上报服务
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
控制页面保存时只更新:
|
|
116
|
+
|
|
117
|
+
- `~/.git-ai/config.json`:Git AI 原生设置;
|
|
118
|
+
- `~/.git-ai/filter_plugins.json`:仓库和 Skill 过滤插件策略。
|
|
119
|
+
|
|
120
|
+
过滤逻辑来自仓库中的 `plugins/upload-filter/plugin_filter_runtime.py`。控制页面不会动态生成或改写 Python 脚本,`~/.git-ai` 只保存安装副本和用户配置。
|
|
121
|
+
|
|
122
|
+
## 文件位置
|
|
123
|
+
|
|
124
|
+
| 内容 | 位置 |
|
|
125
|
+
| --- | --- |
|
|
126
|
+
| 过滤运行时源码 | `plugins/upload-filter/plugin_filter_runtime.py` |
|
|
127
|
+
| 跨平台安装器 | `scripts/install.mjs`、`scripts/uninstall.mjs` |
|
|
128
|
+
| 服务适配器 | `scripts/platform-services.mjs` |
|
|
129
|
+
| Git AI 原生配置 | `~/.git-ai/config.json` |
|
|
130
|
+
| 插件策略 | `~/.git-ai/filter_plugins.json` |
|
|
131
|
+
| 原上报端点本机备份 | `~/.git-ai/upstream_metrics.json` |
|
|
132
|
+
| 过滤运行时安装副本 | `~/.git-ai/filters/plugin_filter_runtime.py` |
|
|
133
|
+
| Web 服务安装副本 | `~/.git-ai/control-panel` |
|
|
134
|
+
|
|
135
|
+
## 卸载
|
|
136
|
+
|
|
137
|
+
```bash
|
|
138
|
+
npx git-ai-control uninstall
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
卸载命令会停止两个服务、删除本项目安装的程序副本,并将上报端点恢复为 Git AI 原地址。`config.json`、`filter_plugins.json` 和日志会保留。
|
|
142
|
+
|
|
143
|
+
## 参与贡献
|
|
144
|
+
|
|
145
|
+
欢迎提交 Issue 和 Pull Request,尤其欢迎补充不同 Git AI 版本的兼容性验证、新增独立插件、改进测试覆盖、文档、交互和无障碍能力。
|
|
146
|
+
|
|
147
|
+
```bash
|
|
148
|
+
cd frontend/git-ai-control-panel
|
|
149
|
+
npm ci
|
|
150
|
+
npm run lint
|
|
151
|
+
npm run build
|
|
152
|
+
cd ../..
|
|
153
|
+
npm run check
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
提交 Pull Request 时请说明使用场景、对配置结构或过滤行为的影响、已执行的验证命令;涉及界面变化时请附前后截图。
|
|
157
|
+
|
|
158
|
+
## 发布
|
|
159
|
+
|
|
160
|
+
项目只发布一个跨平台 npm 包。推送与 `package.json` 版本一致的 Git 标签后,GitHub Actions 会在 macOS、Ubuntu 和 Windows 上验证安装器与运行时源码,在 Ubuntu 构建一次前端,校验静态资源,并通过 npm Trusted Publishing(OIDC)发布。
|
|
161
|
+
|
|
162
|
+
## 安全边界
|
|
163
|
+
|
|
164
|
+
- Web 服务只绑定本机回环地址;
|
|
165
|
+
- 不读取或展示 Git AI API key 等敏感字段;
|
|
166
|
+
- 原始上报端点不会写入项目源码,只保存在权限为 `0600` 的本机配置中;
|
|
167
|
+
- 配置保存采用临时文件替换,避免写入中断产生不完整文件;
|
|
168
|
+
- 页面拒绝非本页面来源的修改请求;
|
|
169
|
+
- 插件配置缺失或损坏时,GitHub 默认策略保持全部阻断;
|
|
170
|
+
- 官方版缺少细粒度过滤扩展点时,页面会显示“仅原生配置兼容”,不会把空闲代理误报为已接管。
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "git-ai-control",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.11",
|
|
4
4
|
"description": "Git AI 本地配置与上传隐私控制面板",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
"CHANGELOG.md",
|
|
16
16
|
"COMPATIBILITY.md",
|
|
17
17
|
"README.md",
|
|
18
|
+
"README.zh-CN.md",
|
|
18
19
|
"policy.example.json",
|
|
19
20
|
"server.py"
|
|
20
21
|
],
|
package/server.py
CHANGED
|
@@ -522,6 +522,18 @@ def git_ai_version() -> str:
|
|
|
522
522
|
return "unknown"
|
|
523
523
|
|
|
524
524
|
|
|
525
|
+
def git_ai_updated_at() -> str:
|
|
526
|
+
try:
|
|
527
|
+
timestamp = git_ai_binary_path().stat().st_mtime
|
|
528
|
+
return (
|
|
529
|
+
datetime.fromtimestamp(timestamp, timezone.utc)
|
|
530
|
+
.isoformat()
|
|
531
|
+
.replace("+00:00", "Z")
|
|
532
|
+
)
|
|
533
|
+
except OSError:
|
|
534
|
+
return ""
|
|
535
|
+
|
|
536
|
+
|
|
525
537
|
@lru_cache(maxsize=1)
|
|
526
538
|
def custom_metrics_supported() -> bool:
|
|
527
539
|
binary = git_ai_binary_path()
|
|
@@ -584,6 +596,7 @@ def runtime_status() -> dict:
|
|
|
584
596
|
"service": service,
|
|
585
597
|
"platform": platform.system().lower(),
|
|
586
598
|
"gitAiVersion": git_ai_version(),
|
|
599
|
+
"gitAiUpdatedAt": git_ai_updated_at(),
|
|
587
600
|
"paths": {
|
|
588
601
|
"nativeConfig": str(NATIVE_CONFIG_PATH),
|
|
589
602
|
"policyConfig": str(POLICY_CONFIG_PATH),
|