agy-family 0.2.10 → 0.2.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/packages/cli/bin/agy-family.mjs +1 -1
- package/packages/cli/src/hook.mjs +1 -1
- package/packages/cli/src/host.mjs +3 -3
- package/packages/core/src/sync.mjs +2 -2
- package/packages/server-core/src/index.mjs +14 -2
- package/packages/server-core/src/schema.mjs +1 -1
- package/packages/server-core/src/ui.mjs +27 -24
- package/wrangler.jsonc +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agy-family",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.11",
|
|
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",
|
|
@@ -47,7 +47,7 @@ import {
|
|
|
47
47
|
writeHostConfig,
|
|
48
48
|
} from '../src/host.mjs';
|
|
49
49
|
|
|
50
|
-
const CLI_VERSION = '0.2.
|
|
50
|
+
const CLI_VERSION = '0.2.11';
|
|
51
51
|
const THIS_CLI_PATH = fileURLToPath(import.meta.url);
|
|
52
52
|
const PACKAGE_ROOT = resolve(dirname(THIS_CLI_PATH), '..', '..', '..');
|
|
53
53
|
|
|
@@ -716,7 +716,7 @@ export async function runHeadlessSync({ cfg, fullSync = false, home = homedir(),
|
|
|
716
716
|
const { payload, scan, nextSyncedHashes, nextAccountLedger } = await buildSyncPayload({
|
|
717
717
|
deviceId,
|
|
718
718
|
clientKind: 'cli',
|
|
719
|
-
clientVersion: '0.2.
|
|
719
|
+
clientVersion: '0.2.11',
|
|
720
720
|
home,
|
|
721
721
|
fileCache: cache,
|
|
722
722
|
syncedHashes: prevHashes,
|
|
@@ -107,7 +107,7 @@ export function buildWranglerConfig({
|
|
|
107
107
|
workerName = 'agy-family',
|
|
108
108
|
databaseName = 'agy-family-db',
|
|
109
109
|
databaseId = '',
|
|
110
|
-
boardTitle = 'Antigravity
|
|
110
|
+
boardTitle = 'Antigravity 家庭组',
|
|
111
111
|
defaultDailyCapUsd = 10,
|
|
112
112
|
defaultWeeklyCapUsd = 50,
|
|
113
113
|
defaultCycleCapUsd = 150,
|
|
@@ -127,7 +127,7 @@ export function buildWranglerConfig({
|
|
|
127
127
|
},
|
|
128
128
|
],
|
|
129
129
|
vars: {
|
|
130
|
-
BOARD_TITLE: String(boardTitle || 'Antigravity
|
|
130
|
+
BOARD_TITLE: String(boardTitle || 'Antigravity 家庭组').trim(),
|
|
131
131
|
DEFAULT_DAILY_CAP_USD: String(defaultDailyCapUsd),
|
|
132
132
|
DEFAULT_WEEKLY_CAP_USD: String(defaultWeeklyCapUsd),
|
|
133
133
|
DEFAULT_CYCLE_CAP_USD: String(defaultCycleCapUsd),
|
|
@@ -291,7 +291,7 @@ export async function deployToCloudflare({
|
|
|
291
291
|
const finalDbName = String(
|
|
292
292
|
databaseName || (existing.workerName === finalWorkerName ? existing.databaseName : '') || `${finalWorkerName}-db`,
|
|
293
293
|
).trim();
|
|
294
|
-
const finalTitle = String(boardTitle || existing.boardTitle || 'Antigravity
|
|
294
|
+
const finalTitle = String(boardTitle || existing.boardTitle || 'Antigravity 家庭组').trim();
|
|
295
295
|
|
|
296
296
|
const explicitAdminKey = String(adminKey || '').trim();
|
|
297
297
|
const reusedKey = !rotateKey && !explicitAdminKey && existing.adminKey && (!existing.workerName || existing.workerName === finalWorkerName);
|
|
@@ -82,7 +82,7 @@ export function diffSyncBuckets(buckets, syncedHashes = null, { fullSync = false
|
|
|
82
82
|
export async function buildSyncPayload({
|
|
83
83
|
deviceId,
|
|
84
84
|
clientKind = 'cli',
|
|
85
|
-
clientVersion = '0.2.
|
|
85
|
+
clientVersion = '0.2.11',
|
|
86
86
|
home,
|
|
87
87
|
roots = null,
|
|
88
88
|
sourceFilter = 'all',
|
|
@@ -155,7 +155,7 @@ export async function buildSyncPayload({
|
|
|
155
155
|
deviceId: String(deviceId || deriveAnonymousDeviceId()).slice(0, 32),
|
|
156
156
|
client: {
|
|
157
157
|
kind: clientKind === 'extension' ? 'extension' : 'cli',
|
|
158
|
-
version: String(clientVersion || '0.2.
|
|
158
|
+
version: String(clientVersion || '0.2.11').slice(0, 24),
|
|
159
159
|
},
|
|
160
160
|
account: {
|
|
161
161
|
emailHash: effectiveReportedHash,
|
|
@@ -20,10 +20,10 @@ import {
|
|
|
20
20
|
roundUsd,
|
|
21
21
|
syncServerPricingCache,
|
|
22
22
|
} from './stats.mjs';
|
|
23
|
-
import { renderDashboardHtml } from './ui.mjs';
|
|
23
|
+
import { FAVICON_SVG, renderDashboardHtml } from './ui.mjs';
|
|
24
24
|
import { dispatchWebhook, sendDedupedAlert, validateWebhookUrl } from './webhooks.mjs';
|
|
25
25
|
|
|
26
|
-
export const SERVER_VERSION = '0.2.
|
|
26
|
+
export const SERVER_VERSION = '0.2.11';
|
|
27
27
|
const MAX_BUCKETS_PER_SYNC = 1000;
|
|
28
28
|
const MAX_DEVICES_PER_MEMBER = 8;
|
|
29
29
|
const MAX_TOKENS_PER_BUCKET = 500_000_000;
|
|
@@ -325,6 +325,18 @@ export function createApp({
|
|
|
325
325
|
return jsonRes({ ok: true, version: SERVER_VERSION, runtime, time: now });
|
|
326
326
|
}
|
|
327
327
|
|
|
328
|
+
// Favicon (SVG icon served at both /favicon.svg and /favicon.ico)
|
|
329
|
+
if (request.method === 'GET' && (path === '/favicon.svg' || path === '/favicon.ico')) {
|
|
330
|
+
return new Response(FAVICON_SVG, {
|
|
331
|
+
status: 200,
|
|
332
|
+
headers: {
|
|
333
|
+
'Content-Type': 'image/svg+xml; charset=utf-8',
|
|
334
|
+
'Cache-Control': 'public, max-age=86400',
|
|
335
|
+
'X-Content-Type-Options': 'nosniff',
|
|
336
|
+
},
|
|
337
|
+
});
|
|
338
|
+
}
|
|
339
|
+
|
|
328
340
|
// Public Transparent Dashboard UI
|
|
329
341
|
if (request.method === 'GET' && path === '/') {
|
|
330
342
|
const settings = await loadSettings(db, envDefaults);
|
|
@@ -88,7 +88,7 @@ export const SCHEMA_STATEMENTS = Object.freeze([
|
|
|
88
88
|
]);
|
|
89
89
|
|
|
90
90
|
export const DEFAULT_SETTINGS = Object.freeze({
|
|
91
|
-
boardTitle: 'Antigravity
|
|
91
|
+
boardTitle: 'Antigravity 家庭组',
|
|
92
92
|
defaultDailyCapUsd: 10,
|
|
93
93
|
defaultWeeklyCapUsd: 50,
|
|
94
94
|
defaultCycleCapUsd: 150,
|
|
@@ -6,7 +6,16 @@
|
|
|
6
6
|
// - Signature AI-timeline pastel palette (#dfa88f, #9fc9a2, #9fbbe0, #c0a8dd, #c08532) scoped to telemetry visualizations
|
|
7
7
|
// - Engineered to fit 1920x1080 (viewport ~940-1080px) in one single glanceable screen without page scrolling.
|
|
8
8
|
|
|
9
|
-
export
|
|
9
|
+
export const FAVICON_SVG =
|
|
10
|
+
'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" fill="none">' +
|
|
11
|
+
'<rect x="0.75" y="0.75" width="30.5" height="30.5" rx="7.5" fill="#26251e" stroke="#454339" stroke-width="1.5"/>' +
|
|
12
|
+
'<path d="M9.2 22.8L16 8.2L22.8 22.8" stroke="#f7f7f4" stroke-width="2.7" stroke-linecap="round" stroke-linejoin="round"/>' +
|
|
13
|
+
'<circle cx="16" cy="20.4" r="2.7" fill="#f54e00"/>' +
|
|
14
|
+
'</svg>';
|
|
15
|
+
|
|
16
|
+
const FAVICON_DATA_URI = 'data:image/svg+xml,' + encodeURIComponent(FAVICON_SVG);
|
|
17
|
+
|
|
18
|
+
export function renderDashboardHtml({ boardTitle = 'Antigravity 家庭组' } = {}) {
|
|
10
19
|
const safeTitle = String(boardTitle)
|
|
11
20
|
.replaceAll('&', '&')
|
|
12
21
|
.replaceAll('<', '<')
|
|
@@ -18,7 +27,12 @@ export function renderDashboardHtml({ boardTitle = 'Antigravity Family Board' }
|
|
|
18
27
|
<head>
|
|
19
28
|
<meta charset="utf-8" />
|
|
20
29
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
21
|
-
<title>${safeTitle}
|
|
30
|
+
<title>${safeTitle}</title>
|
|
31
|
+
<link rel="icon" type="image/svg+xml" href="${FAVICON_DATA_URI}" />
|
|
32
|
+
<link rel="shortcut icon" type="image/svg+xml" href="/favicon.svg" />
|
|
33
|
+
<link rel="apple-touch-icon" href="/favicon.svg" />
|
|
34
|
+
<meta name="theme-color" content="#f7f7f4" media="(prefers-color-scheme: light)" />
|
|
35
|
+
<meta name="theme-color" content="#171612" media="(prefers-color-scheme: dark)" />
|
|
22
36
|
<style>
|
|
23
37
|
:root {
|
|
24
38
|
--primary: #f54e00;
|
|
@@ -128,22 +142,15 @@ export function renderDashboardHtml({ boardTitle = 'Antigravity Family Board' }
|
|
|
128
142
|
width: 24px;
|
|
129
143
|
height: 24px;
|
|
130
144
|
border-radius: 6px;
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
place-items: center;
|
|
145
|
+
display: inline-flex;
|
|
146
|
+
align-items: center;
|
|
147
|
+
justify-content: center;
|
|
135
148
|
flex-shrink: 0;
|
|
136
|
-
position: relative;
|
|
137
149
|
}
|
|
138
|
-
.brand-mark
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
right: 4px;
|
|
143
|
-
width: 5px;
|
|
144
|
-
height: 5px;
|
|
145
|
-
border-radius: 50%;
|
|
146
|
-
background: var(--primary);
|
|
150
|
+
.brand-mark svg {
|
|
151
|
+
width: 24px;
|
|
152
|
+
height: 24px;
|
|
153
|
+
display: block;
|
|
147
154
|
}
|
|
148
155
|
.brand-title {
|
|
149
156
|
font-size: 15px;
|
|
@@ -1486,11 +1493,7 @@ export function renderDashboardHtml({ boardTitle = 'Antigravity Family Board' }
|
|
|
1486
1493
|
<div class="top-progress" id="topProgress" aria-hidden="true"><div class="top-progress-bar"></div></div>
|
|
1487
1494
|
<header class="topbar">
|
|
1488
1495
|
<div class="brand-cluster">
|
|
1489
|
-
<div class="brand-mark" aria-hidden="true">
|
|
1490
|
-
<svg width="13" height="13" viewBox="0 0 16 16" fill="none">
|
|
1491
|
-
<path d="M3 11.5L8 3L13 11.5H3Z" stroke="currentColor" stroke-width="1.5" stroke-linejoin="round"/>
|
|
1492
|
-
</svg>
|
|
1493
|
-
</div>
|
|
1496
|
+
<div class="brand-mark" aria-hidden="true">${FAVICON_SVG}</div>
|
|
1494
1497
|
<h1 class="brand-title" id="boardTitle">${safeTitle}</h1>
|
|
1495
1498
|
<span class="sync-pill">
|
|
1496
1499
|
<span class="sync-dot"></span>
|
|
@@ -1673,7 +1676,7 @@ export function renderDashboardHtml({ boardTitle = 'Antigravity Family Board' }
|
|
|
1673
1676
|
|
|
1674
1677
|
<footer class="foot">
|
|
1675
1678
|
<span data-i18n="privacyNote">隐私承诺:客户端仅只读扫描本地 SQLite 数值元数据,绝不上传 Prompt、代码、文件路径或 Google 凭据。</span>
|
|
1676
|
-
<span class="mono">agy-family v0.2.
|
|
1679
|
+
<span class="mono">agy-family v0.2.11 · MIT</span>
|
|
1677
1680
|
</footer>
|
|
1678
1681
|
</main>
|
|
1679
1682
|
|
|
@@ -2703,9 +2706,9 @@ function renderMemberRows(d) {
|
|
|
2703
2706
|
}
|
|
2704
2707
|
|
|
2705
2708
|
function renderBoard(d) {
|
|
2706
|
-
const title = d.boardTitle || 'Antigravity
|
|
2709
|
+
const title = d.boardTitle || 'Antigravity 家庭组';
|
|
2707
2710
|
document.getElementById('boardTitle').textContent = title;
|
|
2708
|
-
document.title = title
|
|
2711
|
+
document.title = title;
|
|
2709
2712
|
document.getElementById('updatedLine').textContent = new Date(d.generatedAt).toLocaleTimeString([], { hour: '2-digit', minute: '2-digit', second: '2-digit' });
|
|
2710
2713
|
|
|
2711
2714
|
const s = d.summary || {};
|