agy-family 0.6.1 → 0.6.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/README.md +8 -8
- package/README.zh-CN.md +12 -12
- package/package.json +1 -1
- package/packages/cli/bin/agy-family.mjs +58 -58
- package/packages/cli/src/hook.mjs +21 -21
- package/packages/cli/src/host.mjs +1 -1
- package/packages/core/src/sync.mjs +2 -2
- package/packages/server-core/src/index.mjs +1 -1
- package/packages/server-core/src/ui.mjs +1 -1
package/README.md
CHANGED
|
@@ -58,16 +58,16 @@ npm i -g agy-family
|
|
|
58
58
|
```
|
|
59
59
|
- **Open the web board passwordlessly** (60s one-time ticket -> 7-day `HttpOnly` cookie; manager machines auto-unlock Admin Console):
|
|
60
60
|
```sh
|
|
61
|
-
agy-family open
|
|
62
|
-
agy-family open <
|
|
63
|
-
agy-family open --joined
|
|
64
|
-
agy-family open --link
|
|
61
|
+
agy-family open # Open active hosted or joined family group board
|
|
62
|
+
agy-family open <group-name|index> # Open a specific hosted board when managing multiple family groups
|
|
63
|
+
agy-family open --joined # Open your joined family group board explicitly
|
|
64
|
+
agy-family open --link # Print a 5-minute single-use link for mobile
|
|
65
65
|
```
|
|
66
|
-
- **Overview all
|
|
66
|
+
- **Overview all family groups, accounts & switch hosts**:
|
|
67
67
|
```sh
|
|
68
|
-
agy-family ls # List all hosted
|
|
69
|
-
agy-family host use <
|
|
70
|
-
agy-family invite "Alice" --email "alice@gmail.com" --quota 20 # Prints ready-to-paste join command (optional `--
|
|
68
|
+
agy-family ls # List all hosted & joined family groups, URLs, members & active account (also `/family ls`)
|
|
69
|
+
agy-family host use <group-name|index> # Switch active hosted family group
|
|
70
|
+
agy-family invite "Alice" --email "alice@gmail.com" --quota 20 # Prints ready-to-paste join command (optional `--group <name>`)
|
|
71
71
|
npm i -g agy-family@latest && agy-family deploy # Idempotent zero-downtime upgrade
|
|
72
72
|
```
|
|
73
73
|
- **Join someone's family board & view dashboard** (works for both Antigravity Desktop IDE & `agy` CLI):
|
package/README.zh-CN.md
CHANGED
|
@@ -40,15 +40,15 @@ packages/
|
|
|
40
40
|
|
|
41
41
|
---
|
|
42
42
|
|
|
43
|
-
## 一、一个 CLI
|
|
43
|
+
## 一、一个 CLI:管理家庭组与加入家庭组全集成(零外部依赖、零密码)
|
|
44
44
|
|
|
45
|
-
只需全局安装一次 `agy-family
|
|
45
|
+
只需全局安装一次 `agy-family`,**成员加入**、**主号订阅余量同步**、**免密打开网页看板**和**管理员部署/发邀请/自托管**全部由这一个包独立完成(免 `git clone`、不依赖任何其他工具):
|
|
46
46
|
|
|
47
47
|
```sh
|
|
48
48
|
npm i -g agy-family
|
|
49
49
|
```
|
|
50
50
|
|
|
51
|
-
-
|
|
51
|
+
- **🏠 管理员免费部署家庭组看板**(Cloudflare Workers + D1 永久免费层,自动创建 D1、跑迁移、默认开启 `cli-only` 隐私保护、生成 Admin Key、同步 `models.dev` 三级定价,加 `--self` 顺便把自己加为主号成员):
|
|
52
52
|
```sh
|
|
53
53
|
agy-family deploy --self --member "你的名字" --email "主号@gmail.com" --daemon
|
|
54
54
|
```
|
|
@@ -58,24 +58,24 @@ npm i -g agy-family
|
|
|
58
58
|
```
|
|
59
59
|
- **🔐 零密码打开网页看板**(一次性 60s 票据换取 7 天 `HttpOnly` 会话,主号电脑自动免密解锁「家庭组管理」后台):
|
|
60
60
|
```sh
|
|
61
|
-
agy-family open #
|
|
62
|
-
agy-family open
|
|
63
|
-
agy-family open --joined #
|
|
61
|
+
agy-family open # 自动打开当前默认家庭组看板
|
|
62
|
+
agy-family open <组名或序号> # 管理多个家庭组时指定打开某一个
|
|
63
|
+
agy-family open --joined # 打开当前「我加入的家庭组」
|
|
64
64
|
agy-family open --link # 生成 5 分钟单次有效链接(方便手机临时看)
|
|
65
65
|
```
|
|
66
|
-
- **📋
|
|
66
|
+
- **📋 一览全部家庭组与账号信息 & 多组切换**:
|
|
67
67
|
```sh
|
|
68
|
-
agy-family ls #
|
|
69
|
-
agy-family host use
|
|
70
|
-
agy-family invite "成员名" --email "member@gmail.com" --quota 20 #
|
|
68
|
+
agy-family ls # 一条命令列出所有管理/加入的家庭组、网址、主号与成员(对话内也可发 /family ls)
|
|
69
|
+
agy-family host use <组名或序号> # 切换当前默认管理的家庭组
|
|
70
|
+
agy-family invite "成员名" --email "member@gmail.com" --quota 20 # 生成一行加入命令(可加 --group <组名>)
|
|
71
71
|
npm i -g agy-family@latest && agy-family deploy # 一键平滑升级云端看板(保留数据与密钥)
|
|
72
72
|
```
|
|
73
|
-
-
|
|
73
|
+
- **👥 家庭成员加入 & 查看面板**(桌面 IDE 和 `agy` CLI 通用):
|
|
74
74
|
```sh
|
|
75
75
|
agy-family join "agyfam://join?d=..." --daemon # 加入家庭组并开启后台同步
|
|
76
76
|
agy-family open # 零密码打开网页看板
|
|
77
77
|
```
|
|
78
|
-
-
|
|
78
|
+
- **🖥️ 本地 / VPS 自托管部署**(零依赖内置 SQLite):
|
|
79
79
|
```sh
|
|
80
80
|
agy-family serve --port 8787
|
|
81
81
|
```
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agy-family",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.2",
|
|
4
4
|
"description": "Zero-privacy-leak transparent usage dashboard, /family slash command, and fair-use budget guardrail for Google One / Antigravity family groups.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -71,7 +71,7 @@ import {
|
|
|
71
71
|
upsertHostEntry,
|
|
72
72
|
} from '../src/host.mjs';
|
|
73
73
|
|
|
74
|
-
const CLI_VERSION = '0.6.
|
|
74
|
+
const CLI_VERSION = '0.6.2';
|
|
75
75
|
const THIS_CLI_PATH = fileURLToPath(import.meta.url);
|
|
76
76
|
const PACKAGE_ROOT = resolve(dirname(THIS_CLI_PATH), '..', '..', '..');
|
|
77
77
|
|
|
@@ -147,19 +147,19 @@ function readFlag(args, name) {
|
|
|
147
147
|
|
|
148
148
|
function printHelp() {
|
|
149
149
|
console.log(`agy-family v${CLI_VERSION} — Google Family Group Transparent Usage Board & /family Hook CLI
|
|
150
|
-
One CLI for both joining a
|
|
150
|
+
One CLI for both joining a Google Family Group and hosting your own family group board.
|
|
151
151
|
|
|
152
152
|
Overview & Quick Access:
|
|
153
|
-
agy-family ls [--offline] [--json] List all hosted
|
|
154
|
-
agy-family open [
|
|
155
|
-
Open a board in your browser passwordlessly via a one-time CLI ticket
|
|
153
|
+
agy-family ls [--offline] [--json] List all hosted & joined family groups, active Google account, members & daemon status
|
|
154
|
+
agy-family open [group] [--joined] [--link] [--readonly] [--ttl 60]
|
|
155
|
+
Open a family group board in your browser passwordlessly via a one-time CLI ticket
|
|
156
156
|
|
|
157
157
|
Join a Family Group (Member):
|
|
158
158
|
agy-family join <agyfam://join?...> [--no-hook] [--daemon]
|
|
159
159
|
Join a Google Family Group board & enable /family in IDE + CLI
|
|
160
160
|
agy-family sync [--dry-run] [--watch] [--full] [--quiet]
|
|
161
161
|
Sync local Desktop IDE + CLI numeric usage (delta by default)
|
|
162
|
-
agy-family status [--period today|7d|cycle|30d] [--
|
|
162
|
+
agy-family status [--period today|7d|cycle|30d] [--group <name|index>]
|
|
163
163
|
View your quota progress and family leaderboard
|
|
164
164
|
agy-family audit Inspect the exact last transmitted JSON payload
|
|
165
165
|
agy-family pricing [sync] View or sync 3-tier model pricing cache (models.dev / litellm)
|
|
@@ -168,14 +168,14 @@ Join a Family Group (Member):
|
|
|
168
168
|
agy-family leave Disconnect this device and delete local invite token
|
|
169
169
|
agy-family uninstall Remove hook, /family skill, OS daemon, and local credentials
|
|
170
170
|
|
|
171
|
-
Host Your Own Board (Family Manager — supports multiple
|
|
171
|
+
Host Your Own Board (Family Manager — supports multiple family groups):
|
|
172
172
|
agy-family deploy [--name agy-family] [--title "..."] [--admin-key <key>] [--self] [--member <name>] [--email <gmail>] [--daemon]
|
|
173
173
|
One-command deploy/upgrade on Cloudflare Workers + D1 (free tier, no git clone)
|
|
174
|
-
agy-family host [show|ls|use <
|
|
175
|
-
List, switch, link, or unlink hosted boards on this machine
|
|
176
|
-
agy-family master [bind|sync|set|status|unlink] [--
|
|
174
|
+
agy-family host [show|ls|use <group>|link|unlink [group]]
|
|
175
|
+
List, switch, link, or unlink hosted family group boards on this machine
|
|
176
|
+
agy-family master [bind|sync|set|status|unlink] [--group <group>] [--email <gmail>] [--daemon]
|
|
177
177
|
Bind master account & auto-capture live 5h / weekly subscription quota (100% standalone, zero secrets)
|
|
178
|
-
agy-family invite <name> [--
|
|
178
|
+
agy-family invite <name> [--group <group>] [--email <gmail>] [--quota <pct>] [--role member|manager]
|
|
179
179
|
Create a member and print their ready-to-paste one-line join command
|
|
180
180
|
agy-family serve [--port 8787] [--db path] [--admin-key <key>] [--title "..."]
|
|
181
181
|
Start a self-hosted Node.js + SQLite board server locally or on a VPS
|
|
@@ -630,7 +630,7 @@ async function main() {
|
|
|
630
630
|
return;
|
|
631
631
|
}
|
|
632
632
|
|
|
633
|
-
if (cmd === 'ls' || cmd === 'list' || cmd === 'info' || cmd === '
|
|
633
|
+
if (cmd === 'ls' || cmd === 'list' || cmd === 'info' || cmd === 'groups') {
|
|
634
634
|
const offline = args.includes('--offline') || args.includes('--no-net');
|
|
635
635
|
const asJson = args.includes('--json');
|
|
636
636
|
|
|
@@ -778,7 +778,7 @@ async function main() {
|
|
|
778
778
|
return mode || '';
|
|
779
779
|
};
|
|
780
780
|
|
|
781
|
-
console.log(`agy-family v${CLI_VERSION} —
|
|
781
|
+
console.log(`agy-family v${CLI_VERSION} — 家庭组与账号总览\n`);
|
|
782
782
|
|
|
783
783
|
console.log('👤 本机当前 Antigravity 账号:');
|
|
784
784
|
if (localAcct) {
|
|
@@ -787,9 +787,9 @@ async function main() {
|
|
|
787
787
|
console.log(' (未检测到本地已登录的 Antigravity 账号)');
|
|
788
788
|
}
|
|
789
789
|
|
|
790
|
-
console.log(`\n
|
|
790
|
+
console.log(`\n🏠 我管理的家庭组 (Hosted Groups — ${hostInfos.length}):`);
|
|
791
791
|
if (hostInfos.length === 0) {
|
|
792
|
-
console.log(' (暂无 — 运行 "agy-family deploy --self --daemon"
|
|
792
|
+
console.log(' (暂无 — 运行 "agy-family deploy --self --daemon" 免费一键部署家庭组看板)');
|
|
793
793
|
} else {
|
|
794
794
|
for (const h of hostInfos) {
|
|
795
795
|
const star = h.active ? '★ ' : ' ';
|
|
@@ -829,18 +829,18 @@ async function main() {
|
|
|
829
829
|
}
|
|
830
830
|
}
|
|
831
831
|
|
|
832
|
-
console.log('\n
|
|
832
|
+
console.log('\n👥 我加入的家庭组 (Joined Group):');
|
|
833
833
|
if (!joinedInfo) {
|
|
834
|
-
console.log(' (
|
|
834
|
+
console.log(' (暂未加入 — 运行 "agy-family join <邀请码> --daemon" 加入家庭组)');
|
|
835
835
|
} else {
|
|
836
836
|
const sameTag = joinedInfo.sameAsHostedIndex
|
|
837
|
-
? ` (
|
|
837
|
+
? ` (同我管理的家庭组 [${joinedInfo.sameAsHostedIndex}] ${joinedInfo.sameAsHostedId})`
|
|
838
838
|
: '';
|
|
839
839
|
console.log(` 网址 : ${joinedInfo.url}${sameTag}`);
|
|
840
840
|
if (joinedInfo.boardTitle) console.log(` 看板 : ${joinedInfo.boardTitle}`);
|
|
841
841
|
const roleTag = joinedInfo.role === 'manager' ? ' [主号]' : joinedInfo.role ? ' [成员]' : '';
|
|
842
842
|
const onlineTag = joinedInfo.online === true ? ' · online' : joinedInfo.online === false ? ' · offline' : '';
|
|
843
|
-
console.log(`
|
|
843
|
+
console.log(` 成员 : ${joinedInfo.memberName || '(已绑定)'}${roleTag}${onlineTag}`);
|
|
844
844
|
if (joinedInfo.emailHint || joinedInfo.hasExpectedEmailHash) {
|
|
845
845
|
const matchLabel =
|
|
846
846
|
joinedInfo.accountMatch === 'matched'
|
|
@@ -863,16 +863,16 @@ async function main() {
|
|
|
863
863
|
|
|
864
864
|
console.log('\n快捷命令:');
|
|
865
865
|
if (hostInfos.length > 1) {
|
|
866
|
-
console.log('
|
|
867
|
-
console.log('
|
|
868
|
-
console.log('
|
|
866
|
+
console.log(' 切换默认家庭组 : agy-family host use <组名或序号>');
|
|
867
|
+
console.log(' 打开指定家庭组 : agy-family open <组名或序号> | agy-family open --joined');
|
|
868
|
+
console.log(' 邀请家庭成员 : agy-family invite "名字" --group <组名或序号> --email "xxx@gmail.com"');
|
|
869
869
|
} else {
|
|
870
870
|
console.log(' 免密打开看板 : agy-family open');
|
|
871
871
|
if (hostInfos.length === 1 && joinedInfo && !joinedInfo.sameAsHostedIndex) {
|
|
872
|
-
console.log('
|
|
872
|
+
console.log(' 打开加入的组 : agy-family open --joined');
|
|
873
873
|
}
|
|
874
874
|
if (hostInfos.length === 1) {
|
|
875
|
-
console.log('
|
|
875
|
+
console.log(' 新建家庭组 : agy-family deploy --name <组名> --title "<看板标题>"');
|
|
876
876
|
}
|
|
877
877
|
}
|
|
878
878
|
return;
|
|
@@ -886,10 +886,10 @@ async function main() {
|
|
|
886
886
|
const ttlSec = ttlFlag ? Number(ttlFlag) || 60 : printLinkOnly ? 300 : 60;
|
|
887
887
|
const urlOverride = readFlag(args, '--url');
|
|
888
888
|
const adminKeyOverride = readFlag(args, '--admin-key');
|
|
889
|
-
const
|
|
889
|
+
const groupFlag = readFlag(args, '--group') || readFlag(args, '--host');
|
|
890
890
|
|
|
891
|
-
const openValueFlags = new Set(['--ttl', '--url', '--admin-key', '--
|
|
892
|
-
let
|
|
891
|
+
const openValueFlags = new Set(['--ttl', '--url', '--admin-key', '--group', '--host']);
|
|
892
|
+
let groupPositional = '';
|
|
893
893
|
for (let i = 1; i < args.length; i++) {
|
|
894
894
|
const a = args[i];
|
|
895
895
|
if (openValueFlags.has(a)) {
|
|
@@ -897,15 +897,15 @@ async function main() {
|
|
|
897
897
|
continue;
|
|
898
898
|
}
|
|
899
899
|
if (a.startsWith('--')) continue;
|
|
900
|
-
if (!
|
|
900
|
+
if (!groupPositional) groupPositional = a;
|
|
901
901
|
}
|
|
902
|
-
const
|
|
902
|
+
const groupSelector = groupFlag || groupPositional;
|
|
903
903
|
|
|
904
904
|
let selectedHost = null;
|
|
905
|
-
if (
|
|
906
|
-
selectedHost = resolveHostEntry(
|
|
905
|
+
if (groupSelector) {
|
|
906
|
+
selectedHost = resolveHostEntry(groupSelector);
|
|
907
907
|
if (!selectedHost) {
|
|
908
|
-
console.error(`Hosted
|
|
908
|
+
console.error(`Hosted family group not found: "${groupSelector}". Run "agy-family ls" to see all family groups.`);
|
|
909
909
|
process.exit(1);
|
|
910
910
|
}
|
|
911
911
|
} else if (!openJoined) {
|
|
@@ -957,13 +957,13 @@ async function main() {
|
|
|
957
957
|
|
|
958
958
|
if (cmd === 'status') {
|
|
959
959
|
const cfg = getOrCreateClientConfig();
|
|
960
|
-
const
|
|
961
|
-
const host =
|
|
962
|
-
if (
|
|
963
|
-
console.error(`Hosted
|
|
960
|
+
const groupSelector = readFlag(args, '--group') || readFlag(args, '--host');
|
|
961
|
+
const host = groupSelector ? resolveHostEntry(groupSelector) : resolveHostEntry('');
|
|
962
|
+
if (groupSelector && !host) {
|
|
963
|
+
console.error(`Hosted family group not found: "${groupSelector}". Run "agy-family ls" to see all family groups.`);
|
|
964
964
|
process.exit(1);
|
|
965
965
|
}
|
|
966
|
-
const targetUrl = (
|
|
966
|
+
const targetUrl = (groupSelector ? host?.url : cfg.url || host?.url) || '';
|
|
967
967
|
if (!targetUrl) {
|
|
968
968
|
console.error('Not joined to any family group yet. Run: agy-family join <agyfam://join?...>');
|
|
969
969
|
process.exit(1);
|
|
@@ -1127,7 +1127,7 @@ async function main() {
|
|
|
1127
1127
|
}
|
|
1128
1128
|
|
|
1129
1129
|
if (cmd === 'invite') {
|
|
1130
|
-
const valueFlags = new Set(['--email', '--quota', '--role', '--color', '--url', '--admin-key', '--
|
|
1130
|
+
const valueFlags = new Set(['--email', '--quota', '--role', '--color', '--url', '--admin-key', '--group', '--host']);
|
|
1131
1131
|
const pos = [];
|
|
1132
1132
|
for (let i = 1; i < args.length; i++) {
|
|
1133
1133
|
const a = args[i];
|
|
@@ -1140,13 +1140,13 @@ async function main() {
|
|
|
1140
1140
|
}
|
|
1141
1141
|
const memberName = pos.join(' ').trim();
|
|
1142
1142
|
if (!memberName) {
|
|
1143
|
-
console.error('Usage: agy-family invite <name> [--
|
|
1143
|
+
console.error('Usage: agy-family invite <name> [--group <group>] [--email <gmail>] [--quota <pct>] [--role member|manager]');
|
|
1144
1144
|
process.exit(1);
|
|
1145
1145
|
}
|
|
1146
|
-
const
|
|
1147
|
-
const hostCfg =
|
|
1148
|
-
if (
|
|
1149
|
-
console.error(`Hosted
|
|
1146
|
+
const groupSelector = readFlag(args, '--group') || readFlag(args, '--host');
|
|
1147
|
+
const hostCfg = groupSelector ? resolveHostEntry(groupSelector) : resolveHostEntry('');
|
|
1148
|
+
if (groupSelector && !hostCfg) {
|
|
1149
|
+
console.error(`Hosted family group not found: "${groupSelector}". Run "agy-family ls" to see all family groups.`);
|
|
1150
1150
|
process.exit(1);
|
|
1151
1151
|
}
|
|
1152
1152
|
const url = readFlag(args, '--url') || hostCfg?.url || '';
|
|
@@ -1192,10 +1192,10 @@ async function main() {
|
|
|
1192
1192
|
const action = (args[1] || 'status').toLowerCase();
|
|
1193
1193
|
const urlOverride = readFlag(args, '--url');
|
|
1194
1194
|
const adminKeyOverride = readFlag(args, '--admin-key');
|
|
1195
|
-
const
|
|
1196
|
-
const host =
|
|
1197
|
-
if (
|
|
1198
|
-
console.error(`Hosted
|
|
1195
|
+
const groupSelector = readFlag(args, '--group') || readFlag(args, '--host');
|
|
1196
|
+
const host = groupSelector ? resolveHostEntry(groupSelector) : resolveHostEntry('');
|
|
1197
|
+
if (groupSelector && !host) {
|
|
1198
|
+
console.error(`Hosted family group not found: "${groupSelector}". Run "agy-family ls" to see all family groups.`);
|
|
1199
1199
|
process.exit(1);
|
|
1200
1200
|
}
|
|
1201
1201
|
const targetUrl = urlOverride || host?.url || '';
|
|
@@ -1358,7 +1358,7 @@ async function main() {
|
|
|
1358
1358
|
console.log(' Or link an existing board : agy-family host link --url <https://...> --admin-key <adm_...>');
|
|
1359
1359
|
return;
|
|
1360
1360
|
}
|
|
1361
|
-
console.log(`Hosted Family
|
|
1361
|
+
console.log(`Hosted Family Groups (${reg.hosts.length}) — Registry: ${hostsRegistryPath()}`);
|
|
1362
1362
|
reg.hosts.forEach((h, idx) => {
|
|
1363
1363
|
const star = h.id === reg.active ? '★' : ' ';
|
|
1364
1364
|
const tag = h.id === reg.active ? ' [active]' : '';
|
|
@@ -1366,21 +1366,21 @@ async function main() {
|
|
|
1366
1366
|
console.log(` URL : ${h.url || '(unknown)'}`);
|
|
1367
1367
|
console.log(` Infra : ${h.provider || 'cloudflare'}${h.workerName ? ` · Worker: ${h.workerName}` : ''}${h.databaseName ? ` · D1: ${h.databaseName}` : ''}`);
|
|
1368
1368
|
});
|
|
1369
|
-
console.log('\nSwitch active
|
|
1369
|
+
console.log('\nSwitch active family group: agy-family host use <name|index>');
|
|
1370
1370
|
return;
|
|
1371
1371
|
}
|
|
1372
1372
|
if (action === 'use' || action === 'switch') {
|
|
1373
1373
|
const selector = args[2] || '';
|
|
1374
1374
|
if (!selector) {
|
|
1375
|
-
console.error('Usage: agy-family host use <
|
|
1375
|
+
console.error('Usage: agy-family host use <group-name|index|url>');
|
|
1376
1376
|
process.exit(1);
|
|
1377
1377
|
}
|
|
1378
1378
|
const switched = setActiveHost(selector);
|
|
1379
1379
|
if (!switched) {
|
|
1380
|
-
console.error(`Hosted
|
|
1380
|
+
console.error(`Hosted family group not found: "${selector}". Run "agy-family host ls" to view saved family groups.`);
|
|
1381
1381
|
process.exit(1);
|
|
1382
1382
|
}
|
|
1383
|
-
console.log(`✓ Switched active
|
|
1383
|
+
console.log(`✓ Switched active family group -> ${switched.entry.id} (${switched.entry.boardTitle || 'Antigravity 家庭组'})`);
|
|
1384
1384
|
console.log(` Board URL : ${switched.entry.url}`);
|
|
1385
1385
|
return;
|
|
1386
1386
|
}
|
|
@@ -1427,12 +1427,12 @@ async function main() {
|
|
|
1427
1427
|
const selector = args[2] && !args[2].startsWith('--') ? args[2] : '';
|
|
1428
1428
|
const res = removeHostEntry(selector);
|
|
1429
1429
|
if (!res.removed) {
|
|
1430
|
-
console.log(selector ? `Hosted
|
|
1430
|
+
console.log(selector ? `Hosted family group not found: "${selector}".` : 'Local host config: not configured.');
|
|
1431
1431
|
return;
|
|
1432
1432
|
}
|
|
1433
|
-
console.log(`✓ Unlinked hosted
|
|
1433
|
+
console.log(`✓ Unlinked hosted family group "${res.removed.id}"${res.removed.url ? ` (${res.removed.url})` : ''}.`);
|
|
1434
1434
|
if (res.nextActive) {
|
|
1435
|
-
console.log(` Active
|
|
1435
|
+
console.log(` Active family group is now: ${res.nextActive.id} (${res.nextActive.url})`);
|
|
1436
1436
|
}
|
|
1437
1437
|
return;
|
|
1438
1438
|
}
|
|
@@ -1441,7 +1441,7 @@ async function main() {
|
|
|
1441
1441
|
const cfg = selector ? resolveHostEntry(selector) : resolveHostEntry('');
|
|
1442
1442
|
if (!cfg) {
|
|
1443
1443
|
if (selector) {
|
|
1444
|
-
console.error(`Hosted
|
|
1444
|
+
console.error(`Hosted family group not found: "${selector}". Run "agy-family host ls" to view saved family groups.`);
|
|
1445
1445
|
process.exit(1);
|
|
1446
1446
|
}
|
|
1447
1447
|
console.log('No hosted board configured on this machine yet.');
|
|
@@ -1453,7 +1453,7 @@ async function main() {
|
|
|
1453
1453
|
console.log(JSON.stringify(cfg, null, 2));
|
|
1454
1454
|
return;
|
|
1455
1455
|
}
|
|
1456
|
-
console.log(`Hosted Family
|
|
1456
|
+
console.log(`Hosted Family Group${reg.hosts.length > 1 ? ` (${cfg.id === reg.active ? 'active' : 'saved'}, ${reg.hosts.length} total)` : ''}:`);
|
|
1457
1457
|
console.log(` Name / ID : ${cfg.id || cfg.workerName || 'agy-family'}`);
|
|
1458
1458
|
console.log(` Provider : ${cfg.provider || 'cloudflare'}`);
|
|
1459
1459
|
console.log(` Board URL : ${cfg.url || '(unknown)'}`);
|
|
@@ -1471,7 +1471,7 @@ async function main() {
|
|
|
1471
1471
|
}
|
|
1472
1472
|
}
|
|
1473
1473
|
if (reg.hosts.length > 1) {
|
|
1474
|
-
console.log(' All
|
|
1474
|
+
console.log(' All Groups : run "agy-family ls" or "agy-family host ls"');
|
|
1475
1475
|
}
|
|
1476
1476
|
return;
|
|
1477
1477
|
}
|
|
@@ -42,8 +42,8 @@ description: View Google Family Group Antigravity usage board, agreed cap progre
|
|
|
42
42
|
|
|
43
43
|
When the \`agy-family\` \`PreInvocation\` hook is active in \`~/.gemini/config/hooks.json\`, bare commands such as:
|
|
44
44
|
- \`/family\` or \`/family today|7d|cycle|30d\`
|
|
45
|
-
- \`/family ls\` (list hosted
|
|
46
|
-
- \`/family open [
|
|
45
|
+
- \`/family ls\` (list hosted & joined family groups, URLs, and bound accounts)
|
|
46
|
+
- \`/family open [group]\` (passwordless one-time browser login link)
|
|
47
47
|
- \`/family sync\` or \`/family sync --full\`
|
|
48
48
|
- \`/family audit\`
|
|
49
49
|
- \`/family join agyfam://join?d=...\`
|
|
@@ -411,19 +411,19 @@ export function parseFamilySlashCommand(rawInput) {
|
|
|
411
411
|
if (flag && flag !== '--full' && flag !== 'full') return null;
|
|
412
412
|
return { kind: 'sync', fullSync: Boolean(flag) };
|
|
413
413
|
}
|
|
414
|
-
if ((sub === 'ls' || sub === 'list' || sub === 'info' || sub === '
|
|
414
|
+
if ((sub === 'ls' || sub === 'list' || sub === 'info' || sub === 'groups') && rest.length === 1) {
|
|
415
415
|
return { kind: 'ls' };
|
|
416
416
|
}
|
|
417
417
|
if (sub === 'open' && rest.length <= 2) {
|
|
418
418
|
const arg = rest[1] || '';
|
|
419
419
|
const low = arg.toLowerCase();
|
|
420
420
|
if (!arg || low === '--link' || low === 'link') {
|
|
421
|
-
return { kind: 'open', linkOnly: Boolean(arg),
|
|
421
|
+
return { kind: 'open', linkOnly: Boolean(arg), group: '', joined: false };
|
|
422
422
|
}
|
|
423
423
|
if (low === '--joined' || low === 'joined') {
|
|
424
|
-
return { kind: 'open', linkOnly: false,
|
|
424
|
+
return { kind: 'open', linkOnly: false, group: '', joined: true };
|
|
425
425
|
}
|
|
426
|
-
return { kind: 'open', linkOnly: false,
|
|
426
|
+
return { kind: 'open', linkOnly: false, group: arg, joined: false };
|
|
427
427
|
}
|
|
428
428
|
if (sub === 'audit' && rest.length === 1) {
|
|
429
429
|
return { kind: 'audit' };
|
|
@@ -642,8 +642,8 @@ export async function handlePreInvocation(
|
|
|
642
642
|
'### `/family` 指令速查 *(0 tokens)*',
|
|
643
643
|
'',
|
|
644
644
|
'- `/family` 或 `/family 7d` / `/family cycle` / `/family 30d` — 查看家庭组用量排行与主号订阅余量',
|
|
645
|
-
'- `/family ls` —
|
|
646
|
-
'- `/family open [
|
|
645
|
+
'- `/family ls` — 一览本机管理与加入的所有家庭组(网址、主号、成员与当前账号)',
|
|
646
|
+
'- `/family open [组名或序号]` — 生成一次性免密登录链接打开网页看板(无需密码)',
|
|
647
647
|
'- `/family sync` 或 `/family sync --full` — 立即增量/全量同步本机 IDE + CLI 用量',
|
|
648
648
|
'- `/family audit` — 查看最近一次上报的脱敏 JSON(隐私审计)',
|
|
649
649
|
'- `/family join agyfam://join?d=...` — 粘贴邀请码加入或切换家庭组',
|
|
@@ -659,15 +659,15 @@ export async function handlePreInvocation(
|
|
|
659
659
|
const mCfg = readMasterConfig({ home });
|
|
660
660
|
const tapSt = inspectStatusLineTap({ home });
|
|
661
661
|
|
|
662
|
-
const lines = ['### `agy-family`
|
|
662
|
+
const lines = ['### `agy-family` 家庭组与账号总览 *(0 tokens)*', ''];
|
|
663
663
|
lines.push(
|
|
664
664
|
`**本机当前 Antigravity 账号**:${localAcct ? `\`${localAcct.maskedEmail}\` (${localAcct.source})` : '未检测到本地登录'}`,
|
|
665
665
|
);
|
|
666
666
|
lines.push('');
|
|
667
667
|
|
|
668
|
-
lines.push(`####
|
|
668
|
+
lines.push(`#### 🏠 我管理的家庭组(${reg.hosts.length})`);
|
|
669
669
|
if (reg.hosts.length === 0) {
|
|
670
|
-
lines.push('- 暂无(终端运行 `agy-family deploy --self --daemon`
|
|
670
|
+
lines.push('- 暂无(终端运行 `agy-family deploy --self --daemon` 可一键免费部署家庭组看板)');
|
|
671
671
|
} else {
|
|
672
672
|
reg.hosts.forEach((h, idx) => {
|
|
673
673
|
const activeBadge = h.id === reg.active ? ' `当前默认`' : '';
|
|
@@ -678,13 +678,13 @@ export async function handlePreInvocation(
|
|
|
678
678
|
}
|
|
679
679
|
lines.push('');
|
|
680
680
|
|
|
681
|
-
lines.push('####
|
|
681
|
+
lines.push('#### 👥 我加入的家庭组');
|
|
682
682
|
if (!cfgLocal?.url) {
|
|
683
|
-
lines.push('-
|
|
683
|
+
lines.push('- 暂未加入(执行 `/family join agyfam://join?d=...` 加入家庭组)');
|
|
684
684
|
} else {
|
|
685
685
|
const joinedUrl = String(cfgLocal.url).replace(/\/+$/, '');
|
|
686
686
|
const sameIdx = reg.hosts.findIndex((h) => h.url === joinedUrl);
|
|
687
|
-
const sameNote = sameIdx >= 0 ? ` *(
|
|
687
|
+
const sameNote = sameIdx >= 0 ? ` *(同我管理的家庭组 [${sameIdx + 1}] ${reg.hosts[sameIdx].id})*` : '';
|
|
688
688
|
let acctNote = '';
|
|
689
689
|
if (cfgLocal.expectedEmailHash) {
|
|
690
690
|
if (localAcct?.emailHash) {
|
|
@@ -699,14 +699,14 @@ export async function handlePreInvocation(
|
|
|
699
699
|
lines.push(
|
|
700
700
|
`- **${cfgLocal.boardTitle || joinedUrl}**${sameNote} — ${joinedUrl}`,
|
|
701
701
|
);
|
|
702
|
-
lines.push(` -
|
|
702
|
+
lines.push(` - 成员:**${cfgLocal.memberName || '(已绑定)'}**${acctNote}`);
|
|
703
703
|
}
|
|
704
704
|
lines.push('');
|
|
705
705
|
|
|
706
706
|
lines.push(
|
|
707
707
|
`**主号余量采集**:${mCfg ? `\`${mCfg.maskedEmail || '已绑定'}\`(${tapSt.installed ? (tapSt.chained ? '已激活 · 链式共存' : '已激活 · 独立') : '未安装 statusLine'})` : '未绑定'}`,
|
|
708
708
|
);
|
|
709
|
-
lines.push('', '`终端完整实时详情:agy-family ls ·
|
|
709
|
+
lines.push('', '`终端完整实时详情:agy-family ls · 切换默认家庭组:agy-family host use <组名或序号>`');
|
|
710
710
|
return buildZeroTokenMarkdownResponse(lines.join('\n'));
|
|
711
711
|
}
|
|
712
712
|
|
|
@@ -769,11 +769,11 @@ export async function handlePreInvocation(
|
|
|
769
769
|
|
|
770
770
|
if (cmd.kind === 'open') {
|
|
771
771
|
let targetHost = null;
|
|
772
|
-
if (cmd.
|
|
773
|
-
targetHost = resolveHostEntry(cmd.
|
|
772
|
+
if (cmd.group) {
|
|
773
|
+
targetHost = resolveHostEntry(cmd.group, { home });
|
|
774
774
|
if (!targetHost) {
|
|
775
775
|
return buildZeroTokenMarkdownResponse(
|
|
776
|
-
`❌ 未找到名为 \`${cmd.
|
|
776
|
+
`❌ 未找到名为 \`${cmd.group}\` 的家庭组。输入 \`/family ls\` 查看所有已记录的家庭组。`,
|
|
777
777
|
);
|
|
778
778
|
}
|
|
779
779
|
} else if (!cmd.joined) {
|
|
@@ -804,7 +804,7 @@ export async function handlePreInvocation(
|
|
|
804
804
|
});
|
|
805
805
|
const roleNote = ticketRes.scope === 'admin' ? '管理员免密会话' : '成员免密会话';
|
|
806
806
|
return buildZeroTokenMarkdownResponse(
|
|
807
|
-
`### 一次性免密登录链接(${roleNote} · ${ticketRes.expiresInSec}s 单次有效 · 0 tokens)\n\n${ticketRes.enterUrl}\n\n也可在终端直接运行 \`agy-family open${cmd.
|
|
807
|
+
`### 一次性免密登录链接(${roleNote} · ${ticketRes.expiresInSec}s 单次有效 · 0 tokens)\n\n${ticketRes.enterUrl}\n\n也可在终端直接运行 \`agy-family open${cmd.group ? ` ${cmd.group}` : ''}\` 自动拉起浏览器。`,
|
|
808
808
|
);
|
|
809
809
|
} catch (err) {
|
|
810
810
|
return buildZeroTokenMarkdownResponse(`❌ 无法签发一次性登录票据:${err?.message || err}`);
|
|
@@ -890,7 +890,7 @@ export async function runHeadlessSync({ cfg, fullSync = false, home = homedir(),
|
|
|
890
890
|
const { payload, scan, nextSyncedHashes, nextAccountLedger } = await buildSyncPayload({
|
|
891
891
|
deviceId,
|
|
892
892
|
clientKind: 'cli',
|
|
893
|
-
clientVersion: '0.6.
|
|
893
|
+
clientVersion: '0.6.2',
|
|
894
894
|
home,
|
|
895
895
|
fileCache: cache,
|
|
896
896
|
syncedHashes: prevHashes,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// Self-hosting & Cloudflare Workers + D1 deployment engine for the unified `agy-family` CLI.
|
|
2
|
-
// Lets any user
|
|
2
|
+
// Lets any user both join a Google Family Group (`agy-family join`) and host their own board (`agy-family deploy` / `invite` / `host` / `serve`)
|
|
3
3
|
// from a single global `npm i -g agy-family` installation — zero `git clone` required.
|
|
4
4
|
|
|
5
5
|
import { spawnSync } from 'node:child_process';
|
|
@@ -83,7 +83,7 @@ export function diffSyncBuckets(buckets, syncedHashes = null, { fullSync = false
|
|
|
83
83
|
export async function buildSyncPayload({
|
|
84
84
|
deviceId,
|
|
85
85
|
clientKind = 'cli',
|
|
86
|
-
clientVersion = '0.6.
|
|
86
|
+
clientVersion = '0.6.2',
|
|
87
87
|
home,
|
|
88
88
|
roots = null,
|
|
89
89
|
sourceFilter = 'all',
|
|
@@ -164,7 +164,7 @@ export async function buildSyncPayload({
|
|
|
164
164
|
deviceId: String(deviceId || deriveAnonymousDeviceId()).slice(0, 32),
|
|
165
165
|
client: {
|
|
166
166
|
kind: clientKind === 'extension' ? 'extension' : 'cli',
|
|
167
|
-
version: String(clientVersion || '0.6.
|
|
167
|
+
version: String(clientVersion || '0.6.2').slice(0, 24),
|
|
168
168
|
...(platformLabel ? { platform: platformLabel } : {}),
|
|
169
169
|
},
|
|
170
170
|
account: {
|
|
@@ -26,7 +26,7 @@ import {
|
|
|
26
26
|
import { FAVICON_SVG, renderDashboardHtml } from './ui.mjs';
|
|
27
27
|
import { dispatchWebhook, sendDedupedAlert, validateWebhookUrl } from './webhooks.mjs';
|
|
28
28
|
|
|
29
|
-
export const SERVER_VERSION = '0.6.
|
|
29
|
+
export const SERVER_VERSION = '0.6.2';
|
|
30
30
|
const MAX_BUCKETS_PER_SYNC = 1000;
|
|
31
31
|
const MAX_DEVICES_PER_MEMBER = 8;
|
|
32
32
|
const MAX_TOKENS_PER_BUCKET = 500_000_000;
|
|
@@ -1924,7 +1924,7 @@ export function renderDashboardHtml({ boardTitle = 'Antigravity 家庭组' } = {
|
|
|
1924
1924
|
|
|
1925
1925
|
<footer class="foot">
|
|
1926
1926
|
<span data-i18n="privacyNote">隐私承诺:客户端仅只读扫描本地 SQLite 数值元数据,绝不上传 Prompt、代码、文件路径或 Google 凭据。</span>
|
|
1927
|
-
<span class="mono">agy-family v0.6.
|
|
1927
|
+
<span class="mono">agy-family v0.6.2 · MIT</span>
|
|
1928
1928
|
</footer>
|
|
1929
1929
|
</main>
|
|
1930
1930
|
|