agy-family 0.6.8 → 0.6.9

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agy-family",
3
- "version": "0.6.8",
3
+ "version": "0.6.9",
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.8';
74
+ const CLI_VERSION = '0.6.9';
75
75
  const THIS_CLI_PATH = fileURLToPath(import.meta.url);
76
76
  const PACKAGE_ROOT = resolve(dirname(THIS_CLI_PATH), '..', '..', '..');
77
77
 
@@ -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.8',
893
+ clientVersion: '0.6.9',
894
894
  home,
895
895
  fileCache: cache,
896
896
  syncedHashes: prevHashes,
@@ -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.8',
86
+ clientVersion = '0.6.9',
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.8').slice(0, 24),
167
+ version: String(clientVersion || '0.6.9').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.8';
29
+ export const SERVER_VERSION = '0.6.9';
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;
@@ -878,7 +878,7 @@ export function createApp({
878
878
  ? url.searchParams.get('source')
879
879
  : 'all';
880
880
  const board = await buildBoardPayload(db, { period, from, to, source, envDefaults, now });
881
- const payload = { ...board, viewer: access.viewer };
881
+ const payload = { ...board, serverVersion: SERVER_VERSION, viewer: access.viewer };
882
882
  return jsonRes(payload, 200, {}, { allowCors: settings.boardAccessMode !== 'cli-only' });
883
883
  }
884
884
 
@@ -930,7 +930,7 @@ export function createApp({
930
930
  : 'today';
931
931
  const detail = await buildMemberDetailPayload(db, memberId, { period, from, to, envDefaults, now });
932
932
  if (!detail) return jsonRes({ error: 'Member not found.' }, 404, {}, { allowCors: settings.boardAccessMode !== 'cli-only' });
933
- return jsonRes(detail, 200, {}, { allowCors: settings.boardAccessMode !== 'cli-only' });
933
+ return jsonRes({ ...detail, serverVersion: SERVER_VERSION }, 200, {}, { allowCors: settings.boardAccessMode !== 'cli-only' });
934
934
  }
935
935
 
936
936
  // Member Usage Sync (Bearer member token)
@@ -1528,7 +1528,7 @@ export async function buildBoardPayload(
1528
1528
  let knownDeviceRows = [];
1529
1529
  try {
1530
1530
  knownDeviceRows = await db.all(
1531
- 'SELECT member_id, device_id, platform, last_ip, last_country, last_seen_at FROM member_devices ORDER BY last_seen_at DESC',
1531
+ 'SELECT member_id, device_id, platform, client_kind, client_version, last_ip, last_country, last_seen_at FROM member_devices ORDER BY last_seen_at DESC',
1532
1532
  );
1533
1533
  } catch {
1534
1534
  knownDeviceRows = [];
@@ -1640,8 +1640,8 @@ export async function buildBoardPayload(
1640
1640
  },
1641
1641
  topModels,
1642
1642
  lastSeenAt: agg.lastSeenAt,
1643
- lastClientKind: agg.lastClientKind,
1644
- lastClientVersion: agg.lastClientVersion,
1643
+ lastClientKind: agg.lastClientKind || latestDev?.client_kind || null,
1644
+ lastClientVersion: agg.lastClientVersion || latestDev?.client_version || null,
1645
1645
  online: !isOffline,
1646
1646
  accountBound: Boolean(raw.expected_email_hash),
1647
1647
  email: formatBoardEmail(raw.email_address, raw.email_hint, maskPublicEmail),
@@ -2143,6 +2143,7 @@ export async function buildMemberDetailPayload(
2143
2143
  return {
2144
2144
  ...d,
2145
2145
  platform: meta?.platform || '',
2146
+ clientKind: meta?.client_kind || '',
2146
2147
  clientVersion: meta?.client_version || '',
2147
2148
  ip: formatBoardIp(meta?.last_ip || '', maskPublicIp),
2148
2149
  maskedIp: formatBoardIp(meta?.last_ip || '', maskPublicIp),
@@ -1016,6 +1016,12 @@ export function renderDashboardHtml({ boardTitle = 'Antigravity 家庭组' } = {
1016
1016
  .ntag-warn { background: var(--warn-bg); color: var(--warn); }
1017
1017
  .ntag-over { background: var(--danger-bg); color: var(--danger); }
1018
1018
  .ntag-gray { background: var(--surface-strong); color: var(--ink); }
1019
+ .ntag-ver {
1020
+ background: var(--canvas-soft);
1021
+ color: var(--body);
1022
+ border: 1px solid var(--hairline);
1023
+ font-weight: 500;
1024
+ }
1019
1025
  .ntag-me { background: rgba(245, 78, 0, 0.12); color: var(--primary); }
1020
1026
 
1021
1027
  /* Row 2: Two-Pane Workspace Grid (Left Member Ledger + Right Telemetry Stack) */
@@ -1106,7 +1112,7 @@ export function renderDashboardHtml({ boardTitle = 'Antigravity 家庭组' } = {
1106
1112
  min-height: 0;
1107
1113
  overflow: auto;
1108
1114
  }
1109
- table { width: 100%; min-width: 580px; border-collapse: collapse; }
1115
+ table { width: 100%; min-width: 640px; border-collapse: collapse; }
1110
1116
  thead th {
1111
1117
  position: sticky;
1112
1118
  top: 0;
@@ -1117,7 +1123,7 @@ export function renderDashboardHtml({ boardTitle = 'Antigravity 家庭组' } = {
1117
1123
  font-weight: 600;
1118
1124
  letter-spacing: 0.03em;
1119
1125
  color: var(--muted);
1120
- padding: 8px 7px;
1126
+ padding: 9px 10px;
1121
1127
  border-bottom: 1px solid var(--hairline);
1122
1128
  white-space: nowrap;
1123
1129
  }
@@ -1125,63 +1131,76 @@ export function renderDashboardHtml({ boardTitle = 'Antigravity 家庭组' } = {
1125
1131
  th.sortable:hover { color: var(--ink); }
1126
1132
  th.sortable.active-sort { color: var(--ink); }
1127
1133
  .sort-ind { display: inline-block; margin-left: 3px; font-size: 10px; color: var(--primary); }
1128
- th:first-child, td:first-child { padding-left: 14px; }
1129
- th:last-child, td:last-child { padding-right: 14px; }
1134
+ th:first-child, td:first-child { padding-left: 16px; }
1135
+ th:last-child, td:last-child { padding-right: 16px; padding-left: 18px; }
1130
1136
  th.r, td.r { text-align: right; }
1137
+ th.col-cap { width: 168px; }
1138
+ th.col-share { width: 112px; }
1139
+ th.col-tok { width: 138px; }
1140
+ th.col-model { width: 178px; }
1131
1141
  td {
1132
- padding: 9px 7px;
1142
+ padding: 11px 10px;
1133
1143
  border-bottom: 1px solid var(--hairline-soft);
1134
1144
  vertical-align: middle;
1135
1145
  }
1136
- tr.member-row { cursor: pointer; }
1146
+ tr.member-row { cursor: pointer; transition: background-color 0.12s ease; }
1137
1147
  tr.member-row:hover td { background: var(--canvas-soft); }
1138
1148
  tr.member-row.is-me td { background: var(--me-bg); }
1139
1149
  tr.member-row.is-me td:first-child { box-shadow: inset 2px 0 0 var(--primary); }
1150
+ tr.member-row.is-expanded td {
1151
+ background: var(--canvas-soft);
1152
+ border-bottom-color: transparent;
1153
+ }
1140
1154
  tr.detail-row td {
1141
1155
  background: var(--canvas-soft);
1142
- padding: 12px 16px;
1156
+ padding: 2px 16px 14px;
1143
1157
  border-bottom: 1px solid var(--hairline);
1144
1158
  }
1145
1159
 
1146
- .member-cell { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
1160
+ .member-cell { display: flex; align-items: center; gap: 8px; min-width: 0; }
1161
+ .member-info { min-width: 0; flex: 1; }
1147
1162
  .toggle-tri {
1148
- width: 16px;
1149
- height: 16px;
1150
- border-radius: 4px;
1163
+ width: 18px;
1164
+ height: 18px;
1165
+ border-radius: 5px;
1151
1166
  display: inline-grid;
1152
1167
  place-items: center;
1153
1168
  color: var(--muted);
1154
- transition: transform 0.14s ease;
1169
+ transition: transform 0.14s ease, background-color 0.12s ease, color 0.12s ease;
1155
1170
  flex-shrink: 0;
1156
1171
  }
1172
+ tr.member-row:hover .toggle-tri { background: var(--hover); color: var(--ink); }
1157
1173
  .toggle-tri.open { transform: rotate(90deg); color: var(--ink); }
1158
- .member-name-row { display: flex; align-items: center; gap: 4px; flex-wrap: nowrap; }
1159
- .member-name-row .ntag { padding: 1px 6px; font-size: 10.5px; letter-spacing: 0; }
1160
- .member-name { font-weight: 500; font-size: 13.5px; color: var(--ink); }
1174
+ .member-name-row { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; row-gap: 3px; }
1175
+ .member-name-row .ntag { padding: 1px 6px; font-size: 10.5px; letter-spacing: 0; line-height: 1.45; }
1176
+ .member-name { font-weight: 600; font-size: 13.5px; color: var(--ink); margin-right: 1px; }
1161
1177
  .member-sub {
1162
1178
  font-size: 11px;
1163
1179
  color: var(--muted);
1164
1180
  display: flex;
1165
1181
  align-items: center;
1182
+ flex-wrap: wrap;
1166
1183
  gap: 5px;
1167
- margin-top: 1px;
1184
+ row-gap: 2px;
1185
+ margin-top: 3px;
1168
1186
  }
1187
+ .meta-sep { color: var(--muted-soft); user-select: none; }
1169
1188
  .live-dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
1170
1189
  .live-dot.on { background: var(--good); }
1171
1190
  .live-dot.off { background: var(--muted-soft); }
1172
1191
 
1173
1192
  /* Quota Progress Bar */
1174
- .meter-box { min-width: 122px; }
1193
+ .meter-box { min-width: 136px; }
1175
1194
  .meter-top {
1176
1195
  display: flex;
1177
1196
  align-items: baseline;
1178
1197
  justify-content: space-between;
1179
1198
  gap: 6px;
1180
1199
  font-size: 11.5px;
1181
- margin-bottom: 4px;
1200
+ margin-bottom: 5px;
1182
1201
  white-space: nowrap;
1183
1202
  }
1184
- .meter-pct { font-weight: 500; color: var(--ink); }
1203
+ .meter-pct { font-weight: 600; color: var(--ink); }
1185
1204
  .meter-pct.warn { color: var(--warn); }
1186
1205
  .meter-pct.over { color: var(--danger); }
1187
1206
  .meter-cap { color: var(--muted); font-size: 11px; }
@@ -1197,33 +1216,102 @@ export function renderDashboardHtml({ boardTitle = 'Antigravity 家庭组' } = {
1197
1216
  .meter-fill.warn { background: var(--warn); }
1198
1217
  .meter-fill.over { background: var(--danger); }
1199
1218
 
1200
- .spend-cell { font-size: 14px; font-weight: 500; color: var(--ink); white-space: nowrap; }
1201
- .sub-cell { font-size: 11px; color: var(--muted); margin-top: 1px; white-space: nowrap; }
1219
+ .spend-cell { font-size: 14px; font-weight: 600; color: var(--ink); white-space: nowrap; }
1220
+ .sub-cell { font-size: 11px; color: var(--muted); margin-top: 2px; white-space: nowrap; }
1202
1221
 
1203
1222
  /* Expanded Row 3-Col Sub-Pane */
1204
1223
  .detail-grid {
1205
1224
  display: grid;
1206
- grid-template-columns: 1fr 1.05fr 1fr;
1207
- gap: 10px;
1225
+ grid-template-columns: repeat(3, minmax(0, 1fr));
1226
+ gap: 12px;
1227
+ align-items: stretch;
1208
1228
  }
1209
1229
  .detail-col {
1210
1230
  background: var(--surface-card);
1211
1231
  border: 1px solid var(--hairline);
1212
1232
  border-radius: var(--r-md);
1213
- padding: 10px 12px;
1233
+ padding: 12px 14px;
1234
+ display: flex;
1235
+ flex-direction: column;
1236
+ gap: 10px;
1237
+ min-width: 0;
1238
+ }
1239
+ .detail-col-head {
1240
+ display: flex;
1241
+ align-items: center;
1242
+ justify-content: space-between;
1243
+ gap: 8px;
1244
+ padding-bottom: 8px;
1245
+ border-bottom: 1px solid var(--hairline-soft);
1214
1246
  }
1215
1247
  .detail-col h4 {
1216
- font-size: 11.5px;
1248
+ font-size: 12px;
1217
1249
  font-weight: 600;
1250
+ color: var(--ink);
1251
+ margin: 0;
1252
+ white-space: nowrap;
1253
+ }
1254
+ .detail-col-meta {
1255
+ font-size: 11px;
1218
1256
  color: var(--muted);
1219
- margin-bottom: 8px;
1257
+ white-space: nowrap;
1258
+ overflow: hidden;
1259
+ text-overflow: ellipsis;
1260
+ }
1261
+ .detail-win-list {
1262
+ display: flex;
1263
+ flex-direction: column;
1264
+ gap: 8px;
1265
+ }
1266
+ .detail-win-head {
1267
+ display: flex;
1268
+ align-items: baseline;
1269
+ justify-content: space-between;
1270
+ gap: 8px;
1271
+ font-size: 11.5px;
1272
+ margin-bottom: 4px;
1273
+ }
1274
+ .detail-kv-grid {
1275
+ margin-top: auto;
1276
+ padding-top: 9px;
1277
+ border-top: 1px solid var(--hairline-soft);
1278
+ display: grid;
1279
+ grid-template-columns: repeat(2, minmax(0, 1fr));
1280
+ gap: 6px;
1281
+ }
1282
+ .detail-kv-tile {
1283
+ background: var(--canvas-soft);
1284
+ border: 1px solid var(--hairline-soft);
1285
+ border-radius: var(--r-sm);
1286
+ padding: 5px 8px;
1287
+ min-width: 0;
1288
+ }
1289
+ .detail-kv-lbl {
1290
+ font-size: 10px;
1291
+ color: var(--muted);
1292
+ line-height: 1.25;
1293
+ margin-bottom: 2px;
1294
+ }
1295
+ .detail-kv-val {
1296
+ font-size: 11px;
1297
+ font-weight: 500;
1298
+ color: var(--ink);
1299
+ white-space: nowrap;
1300
+ overflow: hidden;
1301
+ text-overflow: ellipsis;
1302
+ }
1303
+ .detail-kv-val span {
1304
+ color: var(--muted);
1305
+ font-weight: 400;
1220
1306
  }
1221
1307
  .mini-bars {
1222
1308
  display: flex;
1223
1309
  align-items: flex-end;
1224
- gap: 5px;
1225
- height: 58px;
1226
- padding-bottom: 4px;
1310
+ gap: 6px;
1311
+ flex: 1;
1312
+ min-height: 76px;
1313
+ max-height: 120px;
1314
+ padding: 6px 2px 6px;
1227
1315
  border-bottom: 1px solid var(--hairline-soft);
1228
1316
  }
1229
1317
  .mini-col {
@@ -1231,34 +1319,135 @@ export function renderDashboardHtml({ boardTitle = 'Antigravity 家庭组' } = {
1231
1319
  display: flex;
1232
1320
  flex-direction: column;
1233
1321
  align-items: center;
1234
- gap: 3px;
1322
+ gap: 4px;
1235
1323
  height: 100%;
1236
1324
  justify-content: flex-end;
1237
1325
  }
1238
- .mini-bar { width: 100%; max-width: 14px; min-height: 2px; border-radius: 2px; }
1239
- .mini-lbl { font-size: 10px; color: var(--muted); }
1326
+ .mini-bar { width: 100%; max-width: 18px; min-height: 3px; border-radius: 3px 3px 1px 1px; transition: opacity 0.12s ease; }
1327
+ .mini-col:hover .mini-bar { opacity: 0.82; }
1328
+ .mini-lbl { font-size: 10px; color: var(--muted); line-height: 1; }
1240
1329
  .dev-list {
1241
- margin-top: 7px;
1242
- padding-top: 6px;
1243
- border-top: 1px solid var(--hairline-soft);
1330
+ display: flex;
1331
+ flex-direction: column;
1332
+ gap: 6px;
1333
+ margin-top: auto;
1334
+ }
1335
+ .dev-item {
1336
+ background: var(--canvas-soft);
1337
+ border: 1px solid var(--hairline-soft);
1338
+ border-radius: var(--r-sm);
1339
+ padding: 6px 9px;
1244
1340
  display: flex;
1245
1341
  flex-direction: column;
1246
1342
  gap: 4px;
1343
+ min-width: 0;
1247
1344
  }
1248
- .dev-row {
1345
+ .dev-top, .dev-bot {
1249
1346
  display: flex;
1250
1347
  align-items: center;
1251
1348
  justify-content: space-between;
1252
1349
  gap: 8px;
1350
+ min-width: 0;
1351
+ }
1352
+ .dev-id-grp {
1353
+ display: flex;
1354
+ align-items: center;
1355
+ gap: 5px;
1356
+ min-width: 0;
1357
+ flex-wrap: wrap;
1253
1358
  font-size: 11px;
1254
1359
  color: var(--body);
1255
1360
  }
1256
- .detail-sub-box {
1257
- margin-top: 8px;
1258
- padding-top: 7px;
1361
+ .dev-id-tag { font-weight: 600; color: var(--ink); }
1362
+ .dev-id-grp .ntag { padding: 0 5px; font-size: 10px; line-height: 1.5; }
1363
+ .dev-time { font-size: 10.5px; color: var(--muted); white-space: nowrap; flex-shrink: 0; }
1364
+ .dev-net {
1365
+ font-size: 10.5px;
1366
+ color: var(--muted);
1367
+ min-width: 0;
1368
+ overflow: hidden;
1369
+ text-overflow: ellipsis;
1370
+ white-space: nowrap;
1371
+ }
1372
+ .dev-usage {
1373
+ font-size: 10.5px;
1374
+ color: var(--body);
1375
+ font-weight: 500;
1376
+ white-space: nowrap;
1377
+ flex-shrink: 0;
1378
+ }
1379
+ .detail-model-list {
1380
+ display: flex;
1381
+ flex-direction: column;
1382
+ gap: 8px;
1383
+ }
1384
+ .detail-model-item {
1385
+ display: flex;
1386
+ flex-direction: column;
1387
+ gap: 4px;
1388
+ }
1389
+ .detail-model-head {
1390
+ display: flex;
1391
+ justify-content: space-between;
1392
+ align-items: center;
1393
+ gap: 8px;
1394
+ font-size: 11.5px;
1395
+ }
1396
+ .detail-model-track {
1397
+ width: 100%;
1398
+ height: 4px;
1399
+ border-radius: var(--r-pill);
1400
+ background: var(--surface-strong);
1401
+ overflow: hidden;
1402
+ }
1403
+ .detail-model-fill {
1404
+ height: 100%;
1405
+ border-radius: var(--r-pill);
1406
+ }
1407
+ .detail-audit-box {
1408
+ margin-top: auto;
1409
+ padding: 8px 10px;
1410
+ border-radius: var(--r-sm);
1411
+ background: var(--danger-bg);
1412
+ border: 1px solid color-mix(in srgb, var(--danger) 28%, var(--hairline));
1413
+ }
1414
+ .detail-audit-head {
1415
+ display: flex;
1416
+ align-items: center;
1417
+ justify-content: space-between;
1418
+ gap: 6px;
1419
+ font-size: 11px;
1420
+ font-weight: 600;
1421
+ color: var(--danger);
1422
+ }
1423
+ .detail-audit-head span:first-child {
1424
+ display: inline-flex;
1425
+ align-items: center;
1426
+ gap: 5px;
1427
+ }
1428
+ .detail-audit-time {
1429
+ font-size: 10.5px;
1430
+ font-weight: 400;
1431
+ color: var(--muted);
1432
+ flex-shrink: 0;
1433
+ }
1434
+ .detail-audit-body {
1435
+ margin-top: 4px;
1436
+ font-size: 11px;
1437
+ line-height: 1.48;
1438
+ color: var(--ink);
1439
+ word-break: break-word;
1440
+ }
1441
+ .detail-foot-meta {
1442
+ margin-top: auto;
1443
+ padding-top: 8px;
1259
1444
  border-top: 1px solid var(--hairline-soft);
1445
+ display: flex;
1446
+ align-items: center;
1447
+ justify-content: space-between;
1448
+ gap: 8px;
1260
1449
  font-size: 11px;
1261
- color: var(--body);
1450
+ color: var(--muted);
1262
1451
  }
1263
1452
 
1264
1453
  /* Empty Onboarding Pane inside Left Card */
@@ -1941,6 +2130,7 @@ export function renderDashboardHtml({ boardTitle = 'Antigravity 家庭组' } = {
1941
2130
  .kpi-grid { grid-template-columns: 1fr 1fr; }
1942
2131
  .workspace-grid { grid-template-columns: 1fr; }
1943
2132
  .telemetry-col { grid-template-rows: auto auto; }
2133
+ .detail-grid { grid-template-columns: 1fr; }
1944
2134
  .settings-modal { flex-direction: column; height: 90vh; }
1945
2135
  .settings-sidebar { width: 100%; border-right: none; border-bottom: 1px solid var(--hairline); padding: 10px 12px; }
1946
2136
  .sidebar-nav { flex-direction: row; overflow-x: auto; }
@@ -2111,10 +2301,10 @@ export function renderDashboardHtml({ boardTitle = 'Antigravity 家庭组' } = {
2111
2301
  <thead>
2112
2302
  <tr id="memberTableHead">
2113
2303
  <th class="sortable" data-sort="active"><span data-i18n="colMember">家庭成员</span><span class="sort-ind"></span></th>
2114
- <th class="sortable" data-sort="cap"><span data-i18n="colCap">分配份额与进度</span><span class="sort-ind"></span></th>
2115
- <th class="r sortable active-sort" data-sort="usd"><span data-i18n="colUsd">使用占比</span><span class="sort-ind">↓</span></th>
2116
- <th class="r sortable" data-sort="tokens"><span data-i18n="colTokens">Tokens / 轮次</span><span class="sort-ind"></span></th>
2117
- <th data-i18n="colMix">主要模型与端</th>
2304
+ <th class="col-cap sortable" data-sort="cap"><span data-i18n="colCap">分配份额与进度</span><span class="sort-ind"></span></th>
2305
+ <th class="col-share r sortable active-sort" data-sort="usd"><span data-i18n="colUsd">使用占比</span><span class="sort-ind">↓</span></th>
2306
+ <th class="col-tok r sortable" data-sort="tokens"><span data-i18n="colTokens">Tokens / 轮次</span><span class="sort-ind"></span></th>
2307
+ <th class="col-model" data-i18n="colMix">主要模型与端</th>
2118
2308
  </tr>
2119
2309
  </thead>
2120
2310
  <tbody id="memberRows"></tbody>
@@ -2158,7 +2348,7 @@ export function renderDashboardHtml({ boardTitle = 'Antigravity 家庭组' } = {
2158
2348
 
2159
2349
  <footer class="foot">
2160
2350
  <span data-i18n="privacyNote">隐私承诺:客户端仅只读扫描本地 SQLite 数值元数据,绝不上传 Prompt、代码、文件路径或 Google 凭据。</span>
2161
- <span class="mono">agy-family v0.6.8 · MIT</span>
2351
+ <span class="mono">agy-family v0.6.9 · MIT</span>
2162
2352
  </footer>
2163
2353
  </main>
2164
2354
 
@@ -2589,7 +2779,44 @@ let adminMembersCache = [];
2589
2779
  let adminPricingTable = [];
2590
2780
  let adminCustomPricing = {};
2591
2781
  let adminServerVersion = '';
2782
+ let boardServerVersion = '';
2592
2783
  let editingPriceId = '';
2784
+ function compareSemver(a, b) {
2785
+ const pa = String(a || '').replace(/^v/i, '').split('.').map((n) => parseInt(n, 10) || 0);
2786
+ const pb = String(b || '').replace(/^v/i, '').split('.').map((n) => parseInt(n, 10) || 0);
2787
+ const len = Math.max(pa.length, pb.length, 3);
2788
+ for (let i = 0; i < len; i++) {
2789
+ const da = pa[i] || 0;
2790
+ const db = pb[i] || 0;
2791
+ if (da !== db) return da < db ? -1 : 1;
2792
+ }
2793
+ return 0;
2794
+ }
2795
+ function renderClientVersionTag(kind, version, serverVer, opts) {
2796
+ const ver = String(version || '').trim();
2797
+ const kindLabel = kind === 'extension'
2798
+ ? (lang === 'zh' ? '插件' : 'IDE')
2799
+ : kind === 'cli'
2800
+ ? 'CLI'
2801
+ : '';
2802
+ if (!ver) {
2803
+ if (opts && opts.showUnknown) {
2804
+ return '<span class="ntag ntag-ver mono" style="opacity:.72" title="' + esc(lang === 'zh' ? '旧版本客户端尚未上报版本号,建议升级' : 'Version not reported by older client') + '">' + esc((kindLabel ? kindLabel + ' ' : '') + (lang === 'zh' ? '旧版' : 'old')) + '</span>';
2805
+ }
2806
+ return '';
2807
+ }
2808
+ const refVer = serverVer || boardServerVersion || adminServerVersion || '';
2809
+ const isOutdated = Boolean(refVer && compareSemver(ver, refVer) < 0);
2810
+ const txt = (kindLabel ? kindLabel + ' ' : '') + 'v' + ver + (isOutdated ? (lang === 'zh' ? ' 旧版' : ' old') : '');
2811
+ const tip = isOutdated
2812
+ ? (lang === 'zh'
2813
+ ? '当前 ' + (kindLabel || '客户端') + ' v' + ver + ',服务端已是 v' + refVer + '(可执行 npm i -g agy-family@latest && agy-family hook on 更新)'
2814
+ : 'Running ' + (kindLabel || 'client') + ' v' + ver + '; server is v' + refVer)
2815
+ : (lang === 'zh'
2816
+ ? '当前 ' + (kindLabel || '客户端') + ' 版本 v' + ver + (refVer ? '(已是最新)' : '')
2817
+ : 'Client ' + (kindLabel || '') + ' v' + ver + (refVer ? ' (latest)' : ''));
2818
+ return '<span class="ntag ' + (isOutdated ? 'ntag-warn' : 'ntag-ver') + ' mono" title="' + esc(tip) + '">' + esc(txt) + '</span>';
2819
+ }
2593
2820
  let lastBoardMembers = {};
2594
2821
  let pendingAdminTab = '';
2595
2822
  let currentAdminTab = 'members';
@@ -2999,7 +3226,7 @@ async function fetchBoard(opts) {
2999
3226
  triggerReveal(document.getElementById('modelList'));
3000
3227
  }
3001
3228
  if (expandedMemberId) {
3002
- loadMemberDetail(expandedMemberId);
3229
+ loadMemberDetail(expandedMemberId, { silent });
3003
3230
  }
3004
3231
  } finally {
3005
3232
  if (seq === boardReqSeq && !silent) {
@@ -3168,19 +3395,22 @@ function renderActivityChart(d) {
3168
3395
  svg.onmouseleave = () => tip.classList.remove('show');
3169
3396
  }
3170
3397
 
3171
- async function loadMemberDetail(memberId) {
3398
+ async function loadMemberDetail(memberId, opts) {
3399
+ const silent = Boolean(opts && opts.silent);
3172
3400
  const box = document.getElementById('detail-cell-' + memberId);
3173
3401
  if (!box) return;
3174
3402
  const seq = ++detailReqSeq;
3175
- box.innerHTML =
3176
- '<div class="detail-skel-wrap">' +
3177
- '<div class="detail-skel-head"><span class="inline-spin"></span><span>' + (lang === 'zh' ? '加载成员明细中...' : 'Loading member details...') + '</span></div>' +
3178
- '<div class="detail-grid">' +
3179
- '<div class="detail-col"><div class="skel" style="width:92px;height:11px;margin-bottom:8px"></div><div class="skel" style="width:100%;height:12px;margin-bottom:6px"></div><div class="skel" style="width:86%;height:12px"></div></div>' +
3180
- '<div class="detail-col"><div class="skel" style="width:108px;height:11px;margin-bottom:8px"></div><div class="skel" style="width:100%;height:34px"></div></div>' +
3181
- '<div class="detail-col"><div class="skel" style="width:88px;height:11px;margin-bottom:8px"></div><div class="skel" style="width:100%;height:12px;margin-bottom:6px"></div><div class="skel" style="width:74%;height:12px"></div></div>' +
3182
- '</div>' +
3183
- '</div>';
3403
+ if (!silent || !box.querySelector('.detail-grid')) {
3404
+ box.innerHTML =
3405
+ '<div class="detail-skel-wrap">' +
3406
+ '<div class="detail-skel-head"><span class="inline-spin"></span><span>' + (lang === 'zh' ? '加载成员明细中...' : 'Loading member details...') + '</span></div>' +
3407
+ '<div class="detail-grid">' +
3408
+ '<div class="detail-col"><div class="skel" style="width:92px;height:11px;margin-bottom:8px"></div><div class="skel" style="width:100%;height:12px;margin-bottom:6px"></div><div class="skel" style="width:86%;height:12px"></div></div>' +
3409
+ '<div class="detail-col"><div class="skel" style="width:108px;height:11px;margin-bottom:8px"></div><div class="skel" style="width:100%;height:34px"></div></div>' +
3410
+ '<div class="detail-col"><div class="skel" style="width:88px;height:11px;margin-bottom:8px"></div><div class="skel" style="width:100%;height:12px;margin-bottom:6px"></div><div class="skel" style="width:74%;height:12px"></div></div>' +
3411
+ '</div>' +
3412
+ '</div>';
3413
+ }
3184
3414
  const qs = buildBoardQueryParams(false);
3185
3415
  try {
3186
3416
  const res = await fetch('/api/board/member/' + encodeURIComponent(memberId) + '?' + qs.toString(), { headers: viewHeaders(), credentials: 'same-origin' });
@@ -3193,16 +3423,17 @@ async function loadMemberDetail(memberId) {
3193
3423
  const isPoolMode = q.quotaMode === 'pool';
3194
3424
  const quotaPct = q.quotaPct ?? 100;
3195
3425
  const tb = d.tokensBreakdown || {};
3426
+ const curServerVer = d.serverVersion || boardServerVersion || adminServerVersion || '';
3196
3427
 
3197
3428
  const shareWinItem = (lbl, winObj, usedUsd) => {
3198
3429
  const w = winObj || {};
3199
3430
  const st = w.quotaStatus || 'ok';
3200
3431
  const barPct = Math.min(100, Number(w.quotaUsedPct) || 0);
3201
3432
  const rightTxt = isPoolMode
3202
- ? '<strong style="color:var(--ink)">' + (w.quotaUsedPct || 0) + '%</strong> <span style="color:var(--muted)">/ ' + quotaPct + '% (' + fmtUsd(usedUsd) + ')</span>'
3203
- : '<strong style="color:var(--ink)">' + fmtPct(w.sharePct || 0, usedUsd) + '</strong> <span style="color:var(--muted)">/ ' + quotaPct + '% (' + fmtUsd(usedUsd) + ')</span>';
3204
- return '<div style="margin-bottom:7px">' +
3205
- '<div style="display:flex;justify-content:space-between;font-size:11.5px;margin-bottom:3px">' +
3433
+ ? '<strong style="color:var(--ink)">' + (w.quotaUsedPct || 0) + '%</strong> <span style="color:var(--muted)">/ ' + quotaPct + '% · ' + fmtUsd(usedUsd) + '</span>'
3434
+ : '<strong style="color:var(--ink)">' + fmtPct(w.sharePct || 0, usedUsd) + '</strong> <span style="color:var(--muted)">/ ' + quotaPct + '% · ' + fmtUsd(usedUsd) + '</span>';
3435
+ return '<div>' +
3436
+ '<div class="detail-win-head">' +
3206
3437
  '<span style="color:var(--body)">' + esc(lbl) + '</span>' +
3207
3438
  '<span class="mono">' + rightTxt + '</span>' +
3208
3439
  '</div>' +
@@ -3210,23 +3441,26 @@ async function loadMemberDetail(memberId) {
3210
3441
  '</div>';
3211
3442
  };
3212
3443
 
3213
- const costPartsStr = (tb.totalTokens || 0) > 0
3214
- ? (lang === 'zh'
3215
- ? '新输入 ' + fmtTok(tb.inputTokens) + ' (' + fmtUsd(tb.inputUsd) + ') · 输出 ' + fmtTok(tb.outputTokens) + ' (' + fmtUsd(tb.outputUsd) + ') · 缓存 ' + fmtTok(tb.cacheReadTokens) + ' (' + fmtUsd(tb.cacheReadUsd) + ')'
3216
- : 'In ' + fmtTok(tb.inputTokens) + ' (' + fmtUsd(tb.inputUsd) + ') · Out ' + fmtTok(tb.outputTokens) + ' (' + fmtUsd(tb.outputUsd) + ') · Cache ' + fmtTok(tb.cacheReadTokens) + ' (' + fmtUsd(tb.cacheReadUsd) + ')')
3217
- : 'In 0 · Out 0 · Cache 0';
3218
- const thinkLine = (tb.thinkingTokens || 0) > 0
3219
- ? '<div style="color:var(--muted);margin-top:2px">' + (lang === 'zh' ? '思考占比 ' : 'Thinking ') + (tb.thinkingShareOfOutPct || 0) + '% (' + fmtTok(tb.thinkingTokens) + ')</div>'
3220
- : '';
3221
- const cacheBox =
3222
- '<div class="detail-sub-box mono">' +
3223
- '<div style="display:flex;justify-content:space-between;margin-bottom:2px">' +
3224
- '<span>' + (lang === 'zh' ? '缓存命中率' : 'Cache hit') + '</span>' +
3225
- '<strong style="color:var(--good)">' + (tb.cacheHitPct || 0) + '%</strong>' +
3226
- '</div>' +
3227
- '<div style="color:var(--muted);line-height:1.45">' + esc(costPartsStr) + '</div>' +
3228
- thinkLine +
3444
+ const kvTile = (lbl, mainVal, subVal) =>
3445
+ '<div class="detail-kv-tile">' +
3446
+ '<div class="detail-kv-lbl">' + esc(lbl) + '</div>' +
3447
+ '<div class="detail-kv-val mono" title="' + esc(mainVal + (subVal ? ' ' + subVal : '')) + '">' + esc(mainVal) + (subVal ? ' <span>' + esc(subVal) + '</span>' : '') + '</div>' +
3448
+ '</div>';
3449
+ const fourthTile = (tb.thinkingTokens || 0) > 0
3450
+ ? kvTile(lang === 'zh' ? '思考占比' : 'Thinking', (tb.thinkingShareOfOutPct || 0) + '%', '(' + fmtTok(tb.thinkingTokens) + ')')
3451
+ : (tb.cacheSavedUsd || 0) > 0
3452
+ ? kvTile(lang === 'zh' ? '缓存省约' : 'Cache saved', fmtUsd(tb.cacheSavedUsd), '')
3453
+ : kvTile(lang === 'zh' ? '对话轮次' : 'Steps', String(d.periodSteps || 0), lang === 'zh' ? '轮' : 'steps');
3454
+ const cacheGrid =
3455
+ '<div class="detail-kv-grid">' +
3456
+ kvTile(lang === 'zh' ? '新输入' : 'Input', fmtTok(tb.inputTokens || 0), '(' + fmtUsd(tb.inputUsd || 0) + ')') +
3457
+ kvTile(lang === 'zh' ? '输出' : 'Output', fmtTok(tb.outputTokens || 0), '(' + fmtUsd(tb.outputUsd || 0) + ')') +
3458
+ kvTile(lang === 'zh' ? '缓存读取' : 'Cache read', fmtTok(tb.cacheReadTokens || 0), '(' + fmtUsd(tb.cacheReadUsd || 0) + ')') +
3459
+ fourthTile +
3229
3460
  '</div>';
3461
+ const card1Meta = (tb.totalTokens || 0) > 0
3462
+ ? '<span class="detail-col-meta mono" style="color:var(--good)">' + (lang === 'zh' ? '缓存命中 ' : 'Cache ') + (tb.cacheHitPct || 0) + '%</span>'
3463
+ : '';
3230
3464
 
3231
3465
  const mColor = (lastBoardMembers[memberId] && lastBoardMembers[memberId].color) || 'var(--primary)';
3232
3466
  const maxD = Math.max(0.01, ...(d.daily7d || []).map((x) => x.usd));
@@ -3240,53 +3474,91 @@ async function loadMemberDetail(memberId) {
3240
3474
  const devRows = (d.devices || []).length
3241
3475
  ? '<div class="dev-list">' + d.devices.slice(0, 4).map((dev) => {
3242
3476
  const shortId = '#' + String(dev.deviceId || '').slice(-4);
3243
- const plat = dev.platform ? ' · ' + dev.platform : '';
3477
+ const plat = dev.platform || '';
3478
+ const devKind = dev.clientKind || d.lastClientKind || '';
3479
+ const devVer = dev.clientVersion || d.lastClientVersion || '';
3480
+ const devVerBadge = renderClientVersionTag(devKind, devVer, curServerVer);
3244
3481
  const geoTxt = dev.country ? (dev.city ? dev.country + ' · ' + dev.city : dev.country) : '';
3245
- const net = dev.maskedIp
3246
- ? ' · ' + dev.maskedIp + (geoTxt ? ' (' + geoTxt + ')' : '')
3247
- : (geoTxt ? ' · ' + geoTxt : '');
3248
- const usage = (dev.tokens || 0) > 0 ? ' · ' + fmtPct(dev.sharePct || 0, dev.totalUsd) + ' (' + fmtTok(dev.tokens || 0) + ')' : '';
3249
- return '<div class="dev-row mono">' +
3250
- '<span style="overflow:hidden;text-overflow:ellipsis;white-space:nowrap">' + esc(shortId + plat + net + usage) + '</span>' +
3251
- '<span style="color:var(--muted);flex-shrink:0">' + esc(fmtAgo(dev.lastUpdatedAt)) + '</span>' +
3482
+ const netTxt = dev.maskedIp
3483
+ ? dev.maskedIp + (geoTxt ? ' (' + geoTxt + ')' : '')
3484
+ : (geoTxt || (lang === 'zh' ? '本地网络' : 'Local network'));
3485
+ const usageTxt = (dev.tokens || 0) > 0
3486
+ ? fmtPct(dev.sharePct || 0, dev.totalUsd) + ' · ' + fmtTok(dev.tokens || 0)
3487
+ : (lang === 'zh' ? '本窗口无消耗' : 'No usage');
3488
+ return '<div class="dev-item">' +
3489
+ '<div class="dev-top">' +
3490
+ '<div class="dev-id-grp mono"><span class="dev-id-tag">' + esc(shortId) + '</span>' + (plat ? '<span>' + esc(plat) + '</span>' : '') + devVerBadge + '</div>' +
3491
+ '<span class="dev-time mono">' + esc(fmtAgo(dev.lastUpdatedAt)) + '</span>' +
3492
+ '</div>' +
3493
+ '<div class="dev-bot">' +
3494
+ '<span class="dev-net mono" title="' + esc(netTxt) + '">' + esc(netTxt) + '</span>' +
3495
+ '<span class="dev-usage mono">' + esc(usageTxt) + '</span>' +
3496
+ '</div>' +
3252
3497
  '</div>';
3253
3498
  }).join('') + '</div>'
3254
- : '';
3499
+ : '<div class="detail-foot-meta">' + esc(lang === 'zh' ? '暂无已上报设备' : 'No devices reported') + '</div>';
3500
+
3501
+ const srcHeadParts = [];
3502
+ if (d.sources?.desktopUsd > 0 && d.sources?.cliUsd > 0) {
3503
+ srcHeadParts.push('IDE ' + (d.sources?.desktopPct || 0) + '% / CLI ' + (d.sources?.cliPct || 0) + '%');
3504
+ } else if (d.sources?.desktopUsd > 0) {
3505
+ srcHeadParts.push('IDE 100%');
3506
+ } else if (d.sources?.cliUsd > 0) {
3507
+ srcHeadParts.push('CLI 100%');
3508
+ }
3509
+ srcHeadParts.push((d.deviceCount || 0) + (lang === 'zh' ? ' 台设备' : ' dev'));
3510
+ const card2Meta = '<span class="detail-col-meta mono">' + esc(srcHeadParts.join(' · ')) + '</span>';
3255
3511
 
3256
3512
  const estTip = lang === 'zh' ? '未知新模型枚举,按保守参考单价估算' : 'Fallback model pricing';
3257
- const modRows = (d.modelBreakdown || []).length
3258
- ? d.modelBreakdown.slice(0, 5).map((m, i) => {
3513
+ const modList = d.modelBreakdown || [];
3514
+ const modRows = modList.length
3515
+ ? '<div class="detail-model-list">' + modList.slice(0, 5).map((m, i) => {
3259
3516
  const rTip = m.rate ? (lang === 'zh' ? '单价 (每 1M In/Out/Cache):' : 'Rate/1M: ') + fmtRateShort(m.rate) : '';
3260
- return '<div style="display:flex;justify-content:space-between;align-items:center;gap:6px;font-size:11.5px;margin-bottom:5px" title="' + esc(rTip) + '">' +
3261
- '<span class="model-name"><span class="dot" style="width:6px;height:6px;background:' + CURSOR_TIMELINE_COLORS[i % CURSOR_TIMELINE_COLORS.length] + '"></span>' + esc(m.model) + (m.isEstimated ? ' <span class="ntag ntag-gray" title="' + esc(estTip) + '">est</span>' : '') + '</span>' +
3262
- '<span class="mono"><strong style="color:var(--ink)">' + fmtPct(m.sharePct, m.usd) + '</strong> <span style="color:var(--muted)">(' + fmtUsd(m.usd) + ')</span></span>' +
3517
+ const c = CURSOR_TIMELINE_COLORS[i % CURSOR_TIMELINE_COLORS.length];
3518
+ const w = Math.max(3, Math.min(100, Number(m.sharePct) || 0));
3519
+ return '<div class="detail-model-item" title="' + esc(rTip) + '">' +
3520
+ '<div class="detail-model-head">' +
3521
+ '<span class="model-name"><span class="dot" style="width:6px;height:6px;background:' + c + '"></span>' + esc(m.model) + (m.isEstimated ? ' <span class="ntag ntag-gray" title="' + esc(estTip) + '">est</span>' : '') + '</span>' +
3522
+ '<span class="mono" style="white-space:nowrap"><strong style="color:var(--ink)">' + fmtPct(m.sharePct, m.usd) + '</strong> <span style="color:var(--muted)">(' + fmtUsd(m.usd) + ')</span></span>' +
3523
+ '</div>' +
3524
+ '<div class="detail-model-track"><div class="detail-model-fill" style="width:' + w + '%;background:' + c + '"></div></div>' +
3263
3525
  '</div>';
3264
- }).join('')
3265
- : '<div style="font-size:11.5px;color:var(--muted)">' + (lang === 'zh' ? '暂无记录' : 'No usage') + '</div>';
3266
-
3267
- const auditNote = (d.recentIntegrityEvents || []).length
3268
- ? '<div class="detail-sub-box" style="color:var(--danger)">' + esc(d.recentIntegrityEvents[0].summary) + '</div>'
3526
+ }).join('') + '</div>'
3527
+ : '<div style="font-size:11.5px;color:var(--muted)">' + (lang === 'zh' ? '当前窗口暂无模型用量' : 'No model usage in this window') + '</div>';
3528
+ const card3Meta = modList.length
3529
+ ? '<span class="detail-col-meta mono">' + modList.length + (lang === 'zh' ? ' 个模型 · ' : ' models · ') + fmtUsd(d.periodUsd || 0) + '</span>'
3269
3530
  : '';
3270
3531
 
3271
- const verTxt = d.lastClientVersion ? ' · v' + d.lastClientVersion : '';
3272
- const srcSummary = (d.sources?.desktopUsd > 0 || d.sources?.cliUsd > 0)
3273
- ? (lang === 'zh' ? '桌面 ' : 'IDE ') + (d.sources?.desktopPct || 0) + '% / CLI ' + (d.sources?.cliPct || 0) + '% · ' + (d.deviceCount || 0) + (lang === 'zh' ? ' 台设备' : ' dev') + verTxt
3274
- : (d.deviceCount || 0) + (lang === 'zh' ? ' 台设备' : ' dev') + verTxt;
3532
+ const auditEv = (d.recentIntegrityEvents || [])[0] || null;
3533
+ const shieldSvg = '<svg width="12" height="12" viewBox="0 0 16 16" fill="none" aria-hidden="true"><path d="M8 1.8L13.2 4V7.8C13.2 11 10.9 13.4 8 14.3C5.1 13.4 2.8 11 2.8 7.8V4L8 1.8Z" stroke="currentColor" stroke-width="1.4" stroke-linejoin="round"/><path d="M8 5.4V8.5M8 10.8H8.01" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/></svg>';
3534
+ const card3Bottom = auditEv
3535
+ ? '<div class="detail-audit-box">' +
3536
+ '<div class="detail-audit-head"><span>' + shieldSvg + esc(lang === 'zh' ? '高水位审计保护' : 'Integrity guardrail') + '</span><span class="detail-audit-time mono">' + esc(fmtAgo(auditEv.detected_at)) + '</span></div>' +
3537
+ '<div class="detail-audit-body">' + esc(auditEv.summary) + '</div>' +
3538
+ '</div>'
3539
+ : '<div class="detail-foot-meta mono"><span>' + esc(lang === 'zh' ? '本窗口累计' : 'Window total') + '</span><span>' + (d.periodSteps || 0) + (lang === 'zh' ? ' 轮 · ' : ' steps · ') + fmtTok(d.periodTokens || 0) + '</span></div>';
3275
3540
 
3276
3541
  box.innerHTML =
3277
- '<div class="detail-grid agf-reveal">' +
3278
- '<div class="detail-col"><h4>' + (lang === 'zh' ? '多窗口占比与费用构成' : 'Window shares & cost') + '</h4>' +
3279
- shareWinItem(lang === 'zh' ? '今日' : 'Daily', q.today, caps.dailyUsedUsd) +
3280
- shareWinItem(lang === 'zh' ? '近 7 天' : '7 days', q.weekly, caps.weeklyUsedUsd) +
3281
- shareWinItem(lang === 'zh' ? '本周期' : 'Cycle', q.cycle, caps.cycleUsedUsd) +
3282
- cacheBox +
3542
+ '<div class="detail-grid' + (silent ? '' : ' agf-reveal') + '">' +
3543
+ '<div class="detail-col">' +
3544
+ '<div class="detail-col-head"><h4>' + (lang === 'zh' ? '多窗口占比与费用' : 'Window shares & cost') + '</h4>' + card1Meta + '</div>' +
3545
+ '<div class="detail-win-list">' +
3546
+ shareWinItem(lang === 'zh' ? '今日' : 'Daily', q.today, caps.dailyUsedUsd) +
3547
+ shareWinItem(lang === 'zh' ? '近 7 天' : '7 days', q.weekly, caps.weeklyUsedUsd) +
3548
+ shareWinItem(lang === 'zh' ? '本周期' : 'Cycle', q.cycle, caps.cycleUsedUsd) +
3549
+ '</div>' +
3550
+ cacheGrid +
3283
3551
  '</div>' +
3284
- '<div class="detail-col"><h4>' + (lang === 'zh' ? '近 7 天走势与设备' : '7-day trend & devices') + '</h4>' +
3552
+ '<div class="detail-col">' +
3553
+ '<div class="detail-col-head"><h4>' + (lang === 'zh' ? '近 7 天走势与设备' : '7-day trend & devices') + '</h4>' + card2Meta + '</div>' +
3285
3554
  '<div class="mini-bars">' + bars7d + '</div>' +
3286
- '<div style="font-size:11px;color:var(--muted);margin-top:6px" class="mono">' + esc(srcSummary) + '</div>' +
3287
3555
  devRows +
3288
3556
  '</div>' +
3289
- '<div class="detail-col"><h4>' + (lang === 'zh' ? '模型使用占比' : 'Model share') + '</h4>' + modRows + auditNote + '</div>' +
3557
+ '<div class="detail-col">' +
3558
+ '<div class="detail-col-head"><h4>' + (lang === 'zh' ? '模型使用占比' : 'Model share') + '</h4>' + card3Meta + '</div>' +
3559
+ modRows +
3560
+ card3Bottom +
3561
+ '</div>' +
3290
3562
  '</div>';
3291
3563
 
3292
3564
  focusedMemberDetail = d;
@@ -3370,6 +3642,9 @@ function renderMemberRows(d) {
3370
3642
  const isPoolMode = d.summary?.quotaMode === 'pool';
3371
3643
  const isLowSample = Boolean(d.summary?.isLowSampleRelative);
3372
3644
  const memberCount = Number(d.summary?.memberCount) || sorted.length || 1;
3645
+ const prevExpandedHtml = expandedMemberId
3646
+ ? (document.getElementById('detail-cell-' + expandedMemberId)?.innerHTML || '')
3647
+ : '';
3373
3648
 
3374
3649
  tbody.innerHTML = sorted.map((m) => {
3375
3650
  const rawQStatus = m.quotaStatus || 'ok';
@@ -3448,8 +3723,10 @@ function renderMemberRows(d) {
3448
3723
  subParts.push((lang === 'zh' ? '参考 ' : 'ref ') + fmtUsd(m.usedUsd));
3449
3724
 
3450
3725
  const emailHintHtml = m.emailHint
3451
- ? '<span class="mono" style="color:var(--body)">· ' + esc(m.emailHint) + '</span>'
3726
+ ? '<span class="meta-sep">·</span><span class="mono" style="color:var(--body)">' + esc(m.emailHint) + '</span>'
3452
3727
  : '';
3728
+ const curServerVer = d.serverVersion || boardServerVersion || adminServerVersion || '';
3729
+ const clientVerTag = renderClientVersionTag(m.lastClientKind, m.lastClientVersion, curServerVer, { showUnknown: Boolean(m.lastSeenAt) });
3453
3730
  const mqMem = m.subscriptionQuota || null;
3454
3731
  let memQuotaTag = '';
3455
3732
  if (mqMem && mqMem.gemini) {
@@ -3485,16 +3762,15 @@ function renderMemberRows(d) {
3485
3762
  devMetaBits.push(m.deviceCount + (lang === 'zh' ? ' 台设备' : ' dev'));
3486
3763
  }
3487
3764
  const devMetaHtml = devMetaBits.length
3488
- ? '<span class="mono" style="opacity:.86">· ' + esc(devMetaBits.join(' · ')) + '</span>'
3765
+ ? devMetaBits.map((bit) => '<span class="meta-sep">·</span><span class="mono" style="opacity:.88">' + esc(bit) + '</span>').join('')
3489
3766
  : '';
3490
3767
 
3491
- let rowHtml = '<tr class="member-row' + (isMe ? ' is-me' : '') + '" data-member-id="' + esc(m.id) + '">' +
3768
+ let rowHtml = '<tr class="member-row' + (isMe ? ' is-me' : '') + (isExpanded ? ' is-expanded' : '') + '" data-member-id="' + esc(m.id) + '">' +
3492
3769
  '<td><div class="member-cell">' +
3493
3770
  '<span class="toggle-tri' + (isExpanded ? ' open' : '') + '">' + triSvg + '</span>' +
3494
- '<span class="dot" style="background:' + esc(m.color) + '"></span>' +
3495
- '<div>' +
3496
- '<div class="member-name-row"><span class="member-name">' + esc(m.name) + '</span>' + roleTag + meTag + acctTag + memQuotaTag + statusTag + integrityTag + '</div>' +
3497
- '<div class="member-sub"><span class="live-dot ' + (m.online ? 'on' : 'off') + '"></span><span>' + esc(m.online ? t('online') : t('offline')) + '</span><span>' + esc(fmtAgo(m.lastSeenAt)) + '</span>' + emailHintHtml + devMetaHtml + '</div>' +
3771
+ '<div class="member-info">' +
3772
+ '<div class="member-name-row"><span class="dot" style="background:' + esc(m.color) + '"></span><span class="member-name">' + esc(m.name) + '</span>' + roleTag + meTag + acctTag + clientVerTag + memQuotaTag + statusTag + integrityTag + '</div>' +
3773
+ '<div class="member-sub"><span class="live-dot ' + (m.online ? 'on' : 'off') + '"></span><span>' + esc(m.online ? t('online') : t('offline')) + ' ' + esc(fmtAgo(m.lastSeenAt)) + '</span>' + emailHintHtml + devMetaHtml + '</div>' +
3498
3774
  '</div>' +
3499
3775
  '</div></td>' +
3500
3776
  '<td><div class="meter-box"' + (meterTip ? ' title="' + esc(meterTip) + '"' : '') + '>' +
@@ -3510,9 +3786,14 @@ function renderMemberRows(d) {
3510
3786
  }
3511
3787
  return rowHtml;
3512
3788
  }).join('');
3789
+ if (expandedMemberId && prevExpandedHtml) {
3790
+ const newBox = document.getElementById('detail-cell-' + expandedMemberId);
3791
+ if (newBox) newBox.innerHTML = prevExpandedHtml;
3792
+ }
3513
3793
  }
3514
3794
 
3515
3795
  function renderBoard(d) {
3796
+ if (d.serverVersion) boardServerVersion = d.serverVersion;
3516
3797
  const title = d.boardTitle || 'Antigravity 家庭组';
3517
3798
  document.getElementById('boardTitle').textContent = title;
3518
3799
  document.title = title;
@@ -4023,9 +4304,8 @@ async function loadAdmin() {
4023
4304
  const adminEmail = m.email_address || m.email_hint || '';
4024
4305
  const emailInfo = adminEmail ? ' · ' + adminEmail : '';
4025
4306
  const cliVer = m.last_client_version ? String(m.last_client_version) : '';
4026
- const isOutdatedCli = Boolean(cliVer && adminServerVersion && cliVer !== adminServerVersion);
4027
4307
  const verTag = cliVer
4028
- ? ' <span class="ntag ' + (isOutdatedCli ? 'ntag-warn' : 'ntag-gray') + '" title="' + esc(isOutdatedCli ? (lang === 'zh' ? '服务端已是 v' + adminServerVersion + ',成员可执行 npm i -g agy-family@latest 更新' : 'Server is v' + adminServerVersion) : 'Client version') + '">v' + esc(cliVer) + (isOutdatedCli ? (lang === 'zh' ? ' 旧版' : ' old') : '') + '</span>'
4308
+ ? ' ' + renderClientVersionTag(m.last_client_kind, cliVer, adminServerVersion)
4029
4309
  : '';
4030
4310
  const acctAdminTag = m.account_status === 'verified'
4031
4311
  ? ' <span class="ntag ntag-good">' + esc(t('acctVerified')) + '</span>'
@@ -4776,7 +5056,7 @@ function scheduleAutoRefresh() {
4776
5056
  if (autoRefreshSec > 0) {
4777
5057
  autoRefreshTimer = setInterval(() => {
4778
5058
  if (document.hidden) return;
4779
- fetchBoard({ silent: true });
5059
+ fetchBoard({ silent: true }).catch(() => {});
4780
5060
  }, autoRefreshSec * 1000);
4781
5061
  }
4782
5062
  }
@@ -4795,7 +5075,7 @@ document.getElementById('autoRefreshSelect')?.addEventListener('change', (ev) =>
4795
5075
 
4796
5076
  document.addEventListener('visibilitychange', () => {
4797
5077
  if (!document.hidden && autoRefreshSec > 0 && Date.now() - lastBoardFetchedAt >= autoRefreshSec * 1000) {
4798
- fetchBoard({ silent: true });
5078
+ fetchBoard({ silent: true }).catch(() => {});
4799
5079
  }
4800
5080
  });
4801
5081