agy-family 0.0.0-stage → 0.2.2
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/LICENSE +21 -0
- package/README.md +130 -2
- package/README.zh-CN.md +150 -0
- package/package.json +58 -4
- package/packages/cli/bin/agy-family.mjs +430 -0
- package/packages/cli/src/hook.mjs +729 -0
- package/packages/core/src/buckets.mjs +69 -0
- package/packages/core/src/index.mjs +7 -0
- package/packages/core/src/invite.mjs +112 -0
- package/packages/core/src/pricing.mjs +63 -0
- package/packages/core/src/protobuf.mjs +102 -0
- package/packages/core/src/scanner.mjs +192 -0
- package/packages/core/src/sync.mjs +171 -0
- package/packages/core/src/wal.mjs +179 -0
- package/packages/server-core/src/crypto.mjs +40 -0
- package/packages/server-core/src/index.mjs +1002 -0
- package/packages/server-core/src/schema.mjs +119 -0
- package/packages/server-core/src/stats.mjs +1245 -0
- package/packages/server-core/src/ui.mjs +2739 -0
- package/packages/server-core/src/webhooks.mjs +151 -0
- package/packages/server-node/src/db-sqlite.mjs +56 -0
- package/packages/server-node/src/server.mjs +155 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 agy-family contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,131 @@
|
|
|
1
|
-
#
|
|
1
|
+
# agy-family
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
**Zero-privacy-leak transparent usage dashboard & fair-use budget guardrail for Google One / Antigravity family groups.**
|
|
4
|
+
|
|
5
|
+
**English** · [简体中文](./README.zh-CN.md)
|
|
6
|
+
|
|
7
|
+
[](https://deploy.workers.cloudflare.com/?url=https://github.com/xy-tuoren/agy-family)
|
|
8
|
+
|
|
9
|
+

|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## Why `agy-family`?
|
|
14
|
+
|
|
15
|
+
Google One (AI Pro / AI Ultra) family groups (1 family manager + up to 5 family members, 6 total) do not provide a native per-member Antigravity usage dashboard or individual quota cap controls. When family members share a plan across **Antigravity Desktop IDE** and **`agy` CLI**:
|
|
16
|
+
- Nobody knows who is consuming shared AI Credits or heavy models, leading to unnecessary friction;
|
|
17
|
+
- A runaway agent loop can silently exhaust shared capacity before anyone notices;
|
|
18
|
+
- Most members use the **Desktop IDE** and will never hand over Google credentials, OAuth tokens, code, or chat transcripts.
|
|
19
|
+
|
|
20
|
+
`agy-family` solves this with an open-source, self-hosted, zero-privacy-leak architecture:
|
|
21
|
+
1. **Desktop IDE Extension (`.vsix`) First + Lightweight CLI**: Members install the bilingual (`zh` / `en`) extension in Antigravity IDE (or VS Code), paste a one-line `agyfam://join?...` invite code (which also auto-carries optional board view keys), and are live in 30 seconds — **zero Node setup, zero terminal commands, zero Google OAuth**.
|
|
22
|
+
2. **Auditable Privacy Guarantee + Live SQLite WAL Scanning**: Clients scan local `conversations/*.db` **plus active `.db-wal` transaction frames** strictly read-only, extracting **only numeric step metadata** (hour bucket, source, model, token counts, reference USD estimate). **Prompts, replies, file paths, session IDs, and Google credentials never leave the device.** Members can inspect the exact raw JSON payload anytime inside the IDE or via `agy-family audit`.
|
|
23
|
+
3. **Percentage-First Fair-Use Board + `/family` Zero-Token Command + CSV Settlement**: Evaluates members primarily by **usage percentage (`%`) vs. allocated family quota share (`%`)** (auto-equal split by default, or custom per-member `%`, plus optional monthly AI Pro `1,000` / AI Ultra `25,000` Credits pool progress), with API-equivalent USD (`$`) shown quietly as secondary reference; includes a zero-token `/family` slash command in both Antigravity IDE & `agy` CLI, expandable 7-day trends & cache hit efficiency, 1-click UTF-8 CSV export, and deduped Webhook alerts (Feishu, DingTalk, WeCom, Telegram, Discord, or Generic JSON).
|
|
24
|
+
4. **Anti-Tamper Guardrails & Shared AI Credits Reconciliation**: Enforces a server-side **monotonic high-water mark (`MAX()`)** so reported usage can never be rolled back downward, tracks zero-PII local odometers (`dbFiles`, `allTimeSteps`, `allTimeTokens`) to flag local DB deletion, runs a **6-hour Cron offline check**, and flags **Unattributed Shared Credits Drops** alongside both **offline** and **online-but-$0 ("Ghost Online")** members.
|
|
25
|
+
5. **Free-Tier-Friendly Dual Self-Hosting**: Clients perform **delta-bucket sync** (`--full` optional), paired with **Cloudflare D1 `batch()` / SQLite transactional writes** and per-isolate schema caching — cutting Cloudflare D1 writes by **98%+** while running identically on **Cloudflare Workers + D1** or **Docker Compose (Node 22 + built-in SQLite)**.
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
## Repository Layout
|
|
30
|
+
|
|
31
|
+
```text
|
|
32
|
+
packages/
|
|
33
|
+
├── core/ # Zero-dep read-only SQLite + protobuf usage parser, pricing, hourly buckets, agyfam:// invites
|
|
34
|
+
├── server-core/ # Shared Web-Standard Fetch API server + dark/light zh/en Dashboard UI + Admin Console + Webhooks
|
|
35
|
+
├── worker/ # Cloudflare Workers + D1 adapter (free-tier serverless deployment)
|
|
36
|
+
├── server-node/ # Zero-dep Node.js >=22.13 built-in node:sqlite server for Docker & self-hosting
|
|
37
|
+
├── extension/ # Cross-platform Antigravity IDE / VS Code extension (bundled WASM sql.js -> .vsix)
|
|
38
|
+
└── cli/ # Lightweight zero-dep CLI (join, sync --dry-run, audit, status, leave, serve)
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
---
|
|
42
|
+
|
|
43
|
+
## 1. One-Click Manager Deployment (Choose Either)
|
|
44
|
+
|
|
45
|
+
### Option A: 1-Click Deploy to Cloudflare Workers + D1 (Recommended · Free Tier · Zero CLI)
|
|
46
|
+
|
|
47
|
+
Click the button below — Cloudflare automatically forks the template, provisions a brand-new free D1 database, prompts you for `AGY_FAMILY_ADMIN_KEY`, and deploys (tables auto-initialize on first request):
|
|
48
|
+
|
|
49
|
+
[](https://deploy.workers.cloudflare.com/?url=https://github.com/xy-tuoren/agy-family)
|
|
50
|
+
|
|
51
|
+
Or deploy in one CLI command:
|
|
52
|
+
|
|
53
|
+
```sh
|
|
54
|
+
git clone https://github.com/xy-tuoren/agy-family.git
|
|
55
|
+
cd agy-family
|
|
56
|
+
npm run deploy:cf # Auto-creates D1, runs migrations, sets Admin Key, and deploys
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### Option B: One-Line Docker Deploy (Prebuilt Multi-Arch GHCR Image · No `git clone`)
|
|
60
|
+
|
|
61
|
+
```sh
|
|
62
|
+
curl -fsSL https://raw.githubusercontent.com/xy-tuoren/agy-family/main/scripts/docker-deploy.sh | bash
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
The script generates a strong random `AGY_FAMILY_ADMIN_KEY`, writes `~/agy-family/.env` (`0600`), pulls the multi-arch `ghcr.io/xy-tuoren/agy-family:latest` (`amd64` / `arm64`) image, starts the container, verifies `/health`, and prints your Board URL and Admin Key.
|
|
66
|
+
|
|
67
|
+
Or run directly with a single `docker run`:
|
|
68
|
+
|
|
69
|
+
```sh
|
|
70
|
+
docker run -d --name agy-family --restart unless-stopped \
|
|
71
|
+
-p 8787:8787 \
|
|
72
|
+
-e AGY_FAMILY_ADMIN_KEY="replace-with-strong-secret" \
|
|
73
|
+
-e BOARD_TITLE="Antigravity Family Board" \
|
|
74
|
+
-v agy_family_data:/data \
|
|
75
|
+
ghcr.io/xy-tuoren/agy-family:latest
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
Open your Board URL, click **Manager**, unlock with `AGY_FAMILY_ADMIN_KEY`, create member slots, and send each member their personal `agyfam://join?...` invite code.
|
|
79
|
+
|
|
80
|
+
### Quick Local Run
|
|
81
|
+
|
|
82
|
+
```sh
|
|
83
|
+
AGY_FAMILY_ADMIN_KEY=my-secret npm run serve
|
|
84
|
+
# Open http://127.0.0.1:8787
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
---
|
|
88
|
+
|
|
89
|
+
## 2. Member Onboarding (1 Line — Works in Both IDE & CLI)
|
|
90
|
+
|
|
91
|
+
### Option 1: Unified CLI + Native `/family` Slash Command (Recommended)
|
|
92
|
+
|
|
93
|
+
Install via npm (macOS / Linux / Windows, Node.js ≥ 22.13):
|
|
94
|
+
|
|
95
|
+
```sh
|
|
96
|
+
npm i -g agy-family
|
|
97
|
+
agy-family join "agyfam://join?d=..." --daemon
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
Or use the 1-line curl installer on macOS / Linux (no `git clone` needed):
|
|
101
|
+
|
|
102
|
+
```sh
|
|
103
|
+
curl -fsSL https://raw.githubusercontent.com/xy-tuoren/agy-family/main/scripts/install.sh | bash -s -- "agyfam://join?d=..."
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
This installs the zero-dependency `agy-family` CLI, enables a background OS heartbeat, and registers a global **`/family` zero-token slash command** + **`Stop` auto-sync hook** inside both **Antigravity IDE** and **`agy` CLI**:
|
|
107
|
+
- `/family` or `/family 7d` / `/family cycle` — view family leaderboard & personal cap progress inline (**0 tokens**)
|
|
108
|
+
- `/family sync` — trigger immediate delta sync
|
|
109
|
+
- `/family audit` — inspect the exact last transmitted JSON payload
|
|
110
|
+
- Run `agy-family uninstall` anytime to cleanly remove hooks, skill, daemon, and credentials.
|
|
111
|
+
|
|
112
|
+
### Option 2: Optional `.vsix` Desktop IDE Extension (No Node.js required)
|
|
113
|
+
1. Download the latest `agy-family-*.vsix` from [GitHub Releases](https://github.com/xy-tuoren/agy-family/releases/latest) and drag it into Extensions.
|
|
114
|
+
2. Click the manager's IDE extension link or click **`Join agy-family`** in the status bar and paste your `agyfam://join?d=...` invite code. Shares the same local anonymous `deviceId` as the CLI so running both never double-counts.
|
|
115
|
+
|
|
116
|
+
---
|
|
117
|
+
|
|
118
|
+
## Development & Packaging
|
|
119
|
+
|
|
120
|
+
```sh
|
|
121
|
+
# Run unit + integration + D1 adapter + WASM sql.js tests
|
|
122
|
+
npm test
|
|
123
|
+
|
|
124
|
+
# Build & package the cross-platform IDE extension (.vsix)
|
|
125
|
+
cd packages/extension && npm install && cd ../..
|
|
126
|
+
npm run package:vsix
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
## License
|
|
130
|
+
|
|
131
|
+
MIT
|
package/README.zh-CN.md
ADDED
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
# agy-family
|
|
2
|
+
|
|
3
|
+
**零隐私泄露的 Antigravity Google 家庭组透明用量看板 & 共享额度公平使用插件**
|
|
4
|
+
|
|
5
|
+
[English](./README.md) · **简体中文**
|
|
6
|
+
|
|
7
|
+
[](https://deploy.workers.cloudflare.com/?url=https://github.com/xy-tuoren/agy-family)
|
|
8
|
+
|
|
9
|
+

|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## 为什么做 `agy-family`?
|
|
14
|
+
|
|
15
|
+
Google One(AI Pro / AI Ultra)家庭组(最多 6 人:1 位家庭组管理员 + 最多 5 位家庭成员)没有提供官方的“按成员查看 Antigravity 用量”或“按成员设定共享额度上限”后台——家庭成员各自使用自己的 Google 账号(Desktop IDE + CLI 混用)共享同一池子时,经常遇到:
|
|
16
|
+
- 谁用了多少、谁用高耗模型(Opus / Neon)完全黑盒,缺少透明依据;
|
|
17
|
+
- 有人开着循环 Agent 忘了关,不知不觉把家庭组共享 AI Credits / 共享池烧穿;
|
|
18
|
+
- 家庭成员大多只用 **Antigravity 桌面版 IDE**,既不会折腾命令行,也不可能把 Google 密码、OAuth Token 或代码/聊天记录交出来。
|
|
19
|
+
|
|
20
|
+
`agy-family` 用一套**纯开源、零隐私、30 秒上手**的方案解决这个问题:
|
|
21
|
+
1. **桌面 IDE 插件(`.vsix`)为主,CLI 为辅**:家庭成员在 Antigravity IDE 安装扩展后,只需点击家庭组管理员发来的「一键拉起 IDE 链接」或粘贴 `agyfam://join?...` 邀请码即可上线(自动跟随中英文界面、自动携带可选查看密码),**无需装 Node、无需敲命令、无需登录 Google**。
|
|
22
|
+
2. **严格隐私边界 + 实时 WAL 捕获(成员随时肉眼可查)**:客户端以只读模式解析本机 `conversations/*.db` 与实时 `.db-wal` 事务帧中的**数值统计字段**(小时时间桶、模型名、Token 计数、估算等值 API 美元),**绝不读取或上传任何 Prompt、回复正文、文件路径或账号凭据**;IDE 内置 **一键查看最近上报原始 JSON** 供随时审计。
|
|
23
|
+
3. **百分比优先的 Google 家庭组透明看板 + `/family` 零 Token 指令 + CSV 导出**:内置 **6 人上限(1 位家庭组管理员 + 最多 5 位家庭成员)**与月度账单重置周期;以**组内使用占比(`%`)与分配配额比例(`%`,留空自动均分,也支持自定义比例或 AI Pro `1,000` / AI Ultra `25,000` 共享总池比例追踪)**为核心,折算参考金额(`$`)与可选月费分摊仅作次要展示;支持在 IDE 与 `agy` CLI 对话框直接输入 `/family`(0 Token)、展开多窗口占比与缓存命中效率、一键导出 UTF-8 CSV 报表,以及飞书 / 钉钉 / 企微 / Telegram / Discord 群通知。
|
|
24
|
+
4. **共享 AI Credits 总池对账(防篡改与离线巡检)**:家庭组管理员可在后台登记共享 AI Credits 余额并查看历史水位/审计流水,系统自动比对「共享池实际减少」与「家庭组同窗口上报消耗」,出现大额**未归因消耗(Unattributed)**立刻标红并列出期间离线或假在线 0 上报成员。
|
|
25
|
+
5. **超省配额的双部署支持(零成本或自建)**:客户端默认**增量脏桶同步(Delta Sync)** + 服务端 **D1 `batch()` / SQLite 事务批量写入** + Worker isolate 建表缓存,将 Cloudflare D1 写入量压缩 **98%+**,轻松长驻 **Cloudflare Workers + D1 永久免费层** 或 **Docker 一键自部署**。
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
## 架构一览
|
|
30
|
+
|
|
31
|
+
```text
|
|
32
|
+
packages/
|
|
33
|
+
├── core/ # 零依赖只读 SQLite+Protobuf 数值解析器、定价折算、隐私安全小时桶聚合、agyfam:// 邀请码
|
|
34
|
+
├── server-core/ # 共享服务端核心(API + Notion 风格明/暗中英看板 + 家庭组管理抽屉 + Webhook 告警 + 对账)
|
|
35
|
+
├── worker/ # Cloudflare Workers + D1 适配层(永久免费层部署)
|
|
36
|
+
├── server-node/ # Node.js >=22.13 内置 SQLite 服务端(零第三方运行依赖,Docker 直接运行)
|
|
37
|
+
├── extension/ # Antigravity IDE / VS Code 扩展(内置 WASM sql.js,跨平台 .vsix)
|
|
38
|
+
└── cli/ # 纯 CLI 家庭成员 & 本地测试用命令行(join / sync --dry-run / audit / status / serve)
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
---
|
|
42
|
+
|
|
43
|
+
## 一、家庭组管理员一键部署(3 分钟上线,任选一种)
|
|
44
|
+
|
|
45
|
+
### 方式 A:Cloudflare Workers + D1 一键网页部署(推荐 · 永久免费层 · 零命令行)
|
|
46
|
+
|
|
47
|
+
直接点击下方按钮,Cloudflare 会自动在你的账号里创建免费 D1 数据库、弹窗让你填写管理员密码 `AGY_FAMILY_ADMIN_KEY` 并完成上线(首次访问自动建表):
|
|
48
|
+
|
|
49
|
+
[](https://deploy.workers.cloudflare.com/?url=https://github.com/xy-tuoren/agy-family)
|
|
50
|
+
|
|
51
|
+
喜欢在本地终端一键部署也可以跑:
|
|
52
|
+
|
|
53
|
+
```sh
|
|
54
|
+
git clone https://github.com/xy-tuoren/agy-family.git
|
|
55
|
+
cd agy-family
|
|
56
|
+
npm run deploy:cf # 自动创建 D1、执行迁移、生成/写入 Admin Key 并部署
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### 方式 B:Docker 一行脚本部署(自动拉取 GHCR 多架构镜像,免 `git clone`)
|
|
60
|
+
|
|
61
|
+
```sh
|
|
62
|
+
curl -fsSL https://raw.githubusercontent.com/xy-tuoren/agy-family/main/scripts/docker-deploy.sh | bash
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
脚本会自动生成强随机 `AGY_FAMILY_ADMIN_KEY`、写入 `~/agy-family/.env`(`0600` 权限)、拉取官方多架构镜像 `ghcr.io/xy-tuoren/agy-family:latest`(支持 `amd64` / `arm64`)并启动,终端会直接打印看板地址与管理员密码。
|
|
66
|
+
|
|
67
|
+
也可以直接一条 `docker run` 启动:
|
|
68
|
+
|
|
69
|
+
```sh
|
|
70
|
+
docker run -d --name agy-family --restart unless-stopped \
|
|
71
|
+
-p 8787:8787 \
|
|
72
|
+
-e AGY_FAMILY_ADMIN_KEY="替换成你的强密码" \
|
|
73
|
+
-e BOARD_TITLE="Antigravity 家庭组透明看板" \
|
|
74
|
+
-v agy_family_data:/data \
|
|
75
|
+
ghcr.io/xy-tuoren/agy-family:latest
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
打开看板后点右上角 **「家庭组管理」** 即可:
|
|
79
|
+
- 添加最多 6 位成员(1 位家庭组管理员 + 最多 5 位家庭成员),一键复制专属邀请码 `agyfam://join?d=...` 或一键拉起 IDE 链接(若开启查看密码,新邀请码会自动携带);
|
|
80
|
+
- 随时行内编辑成员姓名 / 家庭组角色 / 标识色 / 个人三档上限、暂停或恢复成员、重置或吊销邀请码;
|
|
81
|
+
- 配置默认日/周/周期约定上限、月度重置日、时区、Credits 换算率、家庭组查看密码、离线判定时长与群 Webhook 告警;
|
|
82
|
+
- 定期登记家庭组共享 AI Credits 真实余额、查看历史水位与防篡改审计流水,并一键导出周期 CSV 报表。
|
|
83
|
+
|
|
84
|
+
### 本地秒级试跑(开发 / 体验)
|
|
85
|
+
|
|
86
|
+
```sh
|
|
87
|
+
AGY_FAMILY_ADMIN_KEY=my-secret npm run serve
|
|
88
|
+
# 访问 http://127.0.0.1:8787
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
---
|
|
92
|
+
|
|
93
|
+
## 二、家庭成员加入(1 行命令,IDE 与 CLI 同时生效)
|
|
94
|
+
|
|
95
|
+
### 方式 1:统一 CLI + 原生 `/family` 零 Token 指令(推荐 · 通吃 Antigravity IDE 与 `agy` CLI)
|
|
96
|
+
|
|
97
|
+
通过 npm 安装(Windows / macOS / Linux 全平台通用,需 Node.js ≥ 22.13):
|
|
98
|
+
|
|
99
|
+
```sh
|
|
100
|
+
npm i -g agy-family
|
|
101
|
+
agy-family join "agyfam://join?d=..." --daemon
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
或者在 macOS / Linux 上直接跑一行安装脚本(无需 `git clone`):
|
|
105
|
+
|
|
106
|
+
```sh
|
|
107
|
+
curl -fsSL https://raw.githubusercontent.com/xy-tuoren/agy-family/main/scripts/install.sh | bash -s -- "agyfam://join?d=..."
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
这 1 行会自动完成:**安装轻量全局命令 `agy-family` → 绑定邀请码 → 在 Antigravity IDE 与 `agy` CLI 全局注册 `/family` 指令与 `Stop` 自动同步 Hook → 开启系统后台定时心跳**。
|
|
111
|
+
|
|
112
|
+
**装好后,无论在 Antigravity IDE 对话框还是 `agy` CLI 终端里都可以随时使用:**
|
|
113
|
+
- `/family` 或 `/family 7d` / `/family cycle` — **0 Token 消耗、毫秒级直接查看**家庭组实时用量榜与个人额度进度;
|
|
114
|
+
- `/family sync` — 立即手动增量同步;
|
|
115
|
+
- `/family audit` — 查看最近一次上报的原始 JSON(隐私审计);
|
|
116
|
+
- 每轮对话结束自动后台增量同步(防抖非阻塞),关掉 IDE 也由系统定时器保持在线;随时 `agy-family uninstall` 一键彻底清理。
|
|
117
|
+
|
|
118
|
+
### 方式 2:备选 `.vsix` 桌面 IDE 扩展(适合未安装 Node.js 的成员)
|
|
119
|
+
|
|
120
|
+
1. 从 [GitHub Releases](https://github.com/xy-tuoren/agy-family/releases/latest) 下载 `agy-family-*.vsix`;
|
|
121
|
+
2. 在 Antigravity IDE(或 VS Code)中拖进扩展面板安装;
|
|
122
|
+
3. 点击家庭组管理员发来的「IDE 扩展链接」,或点击右下角状态栏 **`加入 agy-family`** 粘贴邀请码即可(与 CLI 共享同一本机匿名 `deviceId`,同机双开也不会重复统计)。
|
|
123
|
+
|
|
124
|
+
---
|
|
125
|
+
|
|
126
|
+
## 三、家庭成员隐私承诺与透明边界
|
|
127
|
+
|
|
128
|
+
| 问题 | `agy-family` 的做法 |
|
|
129
|
+
| :--- | :--- |
|
|
130
|
+
| 会读取我的代码、聊天记录或文件路径吗? | **绝不**。仅以 `readOnly` 读取 `steps` 表中 `step_type = 15` 的数值元数据(时间、模型枚举、Token 计数),按小时桶聚合后丢弃全部会话 ID。 |
|
|
131
|
+
| 会碰我的 Google 账号或 OAuth Token 吗? | **绝不**。客户端全程零 Google 登录、零钥匙串读取、零代理劫持。 |
|
|
132
|
+
| 怎么确认没有偷偷上传别的东西? | 100% MIT 开源,且 IDE 扩展与 CLI 均内置 `Inspect Last Sync Payload` / `audit` 功能,发出前也可用 `--dry-run` 逐字节审查。 |
|
|
133
|
+
| 客户端数据能防止恶意篡改或关插件偷跑吗? | **四重防线**:① 服务端强制用可信单价重算 `$`;② **高水位单调锁(`MAX()`)**确保已上报用量永不允许被改小/回退,尝试回退立刻记入防篡改审计并群告警;③ **零隐私本地里程表**监测本机对话库异常删库;④ **定时离线巡检(6h Cron)+ 共享 AI Credits 总池对账**,出现未归因掉血时同时列出「期间离线」与「假在线 0 上报」成员。 |
|
|
134
|
+
|
|
135
|
+
---
|
|
136
|
+
|
|
137
|
+
## 本地开发与打包扩展
|
|
138
|
+
|
|
139
|
+
```sh
|
|
140
|
+
# 运行全部核心 / 服务端 / Cloudflare D1 适配 / WASM SQLite 测试
|
|
141
|
+
npm test
|
|
142
|
+
|
|
143
|
+
# 构建并打包自包含全平台 Antigravity IDE 扩展 (.vsix)
|
|
144
|
+
cd packages/extension && npm install && cd ../..
|
|
145
|
+
npm run package:vsix
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
## License
|
|
149
|
+
|
|
150
|
+
MIT
|
package/package.json
CHANGED
|
@@ -1,6 +1,60 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agy-family",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.2.2",
|
|
4
|
+
"description": "Zero-privacy-leak transparent usage dashboard, /family slash command, and fair-use budget guardrail for Google One / Antigravity family groups.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"bin": {
|
|
8
|
+
"agy-family": "packages/cli/bin/agy-family.mjs"
|
|
9
|
+
},
|
|
10
|
+
"files": [
|
|
11
|
+
"packages/core/src/",
|
|
12
|
+
"packages/cli/bin/",
|
|
13
|
+
"packages/cli/src/",
|
|
14
|
+
"packages/server-core/src/",
|
|
15
|
+
"packages/server-node/src/",
|
|
16
|
+
"README.md",
|
|
17
|
+
"README.zh-CN.md",
|
|
18
|
+
"LICENSE"
|
|
19
|
+
],
|
|
20
|
+
"author": "xy-tuoren",
|
|
21
|
+
"repository": {
|
|
22
|
+
"type": "git",
|
|
23
|
+
"url": "git+https://github.com/xy-tuoren/agy-family.git"
|
|
24
|
+
},
|
|
25
|
+
"bugs": {
|
|
26
|
+
"url": "https://github.com/xy-tuoren/agy-family/issues"
|
|
27
|
+
},
|
|
28
|
+
"homepage": "https://github.com/xy-tuoren/agy-family#readme",
|
|
29
|
+
"keywords": [
|
|
30
|
+
"antigravity",
|
|
31
|
+
"google-one",
|
|
32
|
+
"family-group",
|
|
33
|
+
"ai-usage",
|
|
34
|
+
"quota",
|
|
35
|
+
"cli",
|
|
36
|
+
"fair-use"
|
|
37
|
+
],
|
|
38
|
+
"engines": {
|
|
39
|
+
"node": ">=22.13.0"
|
|
40
|
+
},
|
|
41
|
+
"scripts": {
|
|
42
|
+
"test": "node --test test/*.test.mjs",
|
|
43
|
+
"serve": "node packages/server-node/src/server.mjs",
|
|
44
|
+
"cli": "node packages/cli/bin/agy-family.mjs",
|
|
45
|
+
"deploy": "npx wrangler d1 migrations apply DB --remote && npx wrangler deploy",
|
|
46
|
+
"deploy:cf": "bash scripts/cf-deploy.sh",
|
|
47
|
+
"build:extension": "node packages/extension/esbuild.mjs",
|
|
48
|
+
"package:vsix": "npm --prefix packages/extension run package"
|
|
49
|
+
},
|
|
50
|
+
"cloudflare": {
|
|
51
|
+
"bindings": {
|
|
52
|
+
"AGY_FAMILY_ADMIN_KEY": {
|
|
53
|
+
"description": "Strong secret password for unlocking the Family Group Manager Console (家庭组管理后台). Generate with `openssl rand -hex 16` or any long random passphrase."
|
|
54
|
+
},
|
|
55
|
+
"DB": {
|
|
56
|
+
"description": "Cloudflare D1 SQLite database storing anonymized hourly usage buckets, fair-use rules, and shared AI Credits snapshots."
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|