@crvouga/homelab 0.23.0 → 0.23.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/ansible/ubuntu/tasks/power.yml +1 -1
- package/docs/accounts.md +11 -10
- package/docs/runbooks.md +1 -2
- package/mise.lock +53 -17
- package/mise.toml +8 -8
- package/package.json +2 -2
- package/schema/check-ids.json +0 -8
- package/src/check-registry.ts +0 -2
- package/src/cli/fleet-sync-manager.ts +1 -7
- package/src/t3/local-rpc.ts +0 -34
- package/src/t3/quota-coverage.ts +0 -100
|
@@ -85,7 +85,7 @@
|
|
|
85
85
|
stdin: '{{ firmware_settings.stdout | trim }}'
|
|
86
86
|
environment:
|
|
87
87
|
POWER_LOSS_SETTINGS: '{{ powerLossRecovery.settings | to_json }}'
|
|
88
|
-
POWER_LOSS_VALUES:
|
|
88
|
+
POWER_LOSS_VALUES: "{{ powerLossRecovery['values'] | to_json }}"
|
|
89
89
|
register: power_loss_selection
|
|
90
90
|
changed_when: false
|
|
91
91
|
check_mode: false
|
package/docs/accounts.md
CHANGED
|
@@ -137,16 +137,17 @@ propagates the instance configuration to the workers. Where the provider
|
|
|
137
137
|
requires its own client, complete its sign-in there. A successful proxy login
|
|
138
138
|
alone does not establish permission to use a subscription through a proxy.
|
|
139
139
|
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
the
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
140
|
+
If T3 displays “Sign in with Google to see Antigravity limits” or asks
|
|
141
|
+
for a turn to renew limits, update the consumer project's homelab pin to
|
|
142
|
+
the release containing the T3 quota fix and run `homelab converge` on the
|
|
143
|
+
manager. Check the T3 version on the manager and each worker. An offline
|
|
144
|
+
worker needs to converge when it reconnects.
|
|
145
|
+
|
|
146
|
+
Google supports ACP for external Antigravity clients. The T3 release pinned
|
|
147
|
+
by homelab removes the native and proxy quota readers that called Google's
|
|
148
|
+
internal APIs. Antigravity subscription windows are unavailable in T3 until
|
|
149
|
+
Google exposes them over a supported interface. Use the official Antigravity
|
|
150
|
+
client for limits. [Upstream change](https://github.com/pingdotgg/t3code/pull/43026)
|
|
150
151
|
|
|
151
152
|
## Adding, signing in again, removing
|
|
152
153
|
|
package/docs/runbooks.md
CHANGED
|
@@ -14,7 +14,7 @@ It reads a code by where it stands, never by the word it ends with. The CLI
|
|
|
14
14
|
proxy documents the codes of its own commands in
|
|
15
15
|
[its README](../cliproxy/README.md); the ones converge reports are here.
|
|
16
16
|
|
|
17
|
-
There are
|
|
17
|
+
There are 495 codes; 105 need a person.
|
|
18
18
|
|
|
19
19
|
## Bootstrap of a new or returning worker
|
|
20
20
|
|
|
@@ -355,7 +355,6 @@ runaway, write `1` to that agent scope’s `cgroup.kill`.
|
|
|
355
355
|
- `T3_PROVIDERS_PENDING`: t3 providers pending.
|
|
356
356
|
- `T3_RECONCILIATION_UNAVAILABLE`: a local reconciliation precondition failed. Follow the stage-specific remedy to inspect the receipt, installed definition or T3 settings and ownership record locally. Restore a valid backup or correct permissions, then retry `homelab t3-reconcile --dry-run`. Never share raw file contents.
|
|
357
357
|
- `T3_ACCOUNT_ROSTER_UNAVAILABLE`: the proxy account roster could not be read. Run `homelab accounts` on the affected machine to verify proxy access and the proxy-client-key secret, then retry `homelab t3-reconcile --dry-run`. Existing providers are preserved. If access still fails, report this code without credentials.
|
|
358
|
-
- `T3_QUOTA_COVERAGE_MISSING`: the manager could not match a hub quota reading to each declared Antigravity account. Check its T3 usage-limit source and the account on the proxy.
|
|
359
358
|
- `T3_CLI_MISSING`: the provider check could not start the T3 CLI from PATH or its user installation. Restore the executable and rerun converge to verify the account sessions.
|
|
360
359
|
- `T3_ANTIGRAVITY_SESSION_UNVERIFIED`: T3 could not open an authenticated ACP session for the reported account positions. Check that T3 is running on this machine, refresh those instances in Settings > Providers, and compare their proxy account session checks before rerunning converge.
|
|
361
360
|
- `T3_PROVIDERS_UNVERIFIED`: provider reconciliation stopped before it could report a plan. The remedy is the authored cause (a stale plan, a held lock, or the credential playbook). An unexpected error stays out of the report, because it can carry a secret. Run `homelab t3-reconcile --dry-run` on the machine.
|
package/mise.lock
CHANGED
|
@@ -325,39 +325,75 @@ dependency_prereleases = "allow"
|
|
|
325
325
|
with = '["pip"]'
|
|
326
326
|
|
|
327
327
|
[[tools.bat]]
|
|
328
|
-
version = "0.
|
|
328
|
+
version = "0.27.0"
|
|
329
329
|
backend = "aqua:sharkdp/bat"
|
|
330
|
-
specifiers = ["0.
|
|
330
|
+
specifiers = ["0.27.0"]
|
|
331
331
|
|
|
332
332
|
[tools.bat."platforms.linux-arm64"]
|
|
333
|
-
checksum = "sha256:
|
|
333
|
+
checksum = "sha256:42227d776ba1ee48f7f66d666264e36fbfcb826104bea565b740a6240727635e"
|
|
334
334
|
checksum_source = "mise-versions"
|
|
335
|
-
url = "https://github.com/sharkdp/bat/releases/download/v0.
|
|
336
|
-
url_api = "https://api.github.com/repos/sharkdp/bat/releases/assets/
|
|
335
|
+
url = "https://github.com/sharkdp/bat/releases/download/v0.27.0/bat-v0.27.0-aarch64-unknown-linux-gnu.tar.gz"
|
|
336
|
+
url_api = "https://api.github.com/repos/sharkdp/bat/releases/assets/803661087"
|
|
337
|
+
|
|
338
|
+
[tools.bat."platforms.linux-arm64-musl"]
|
|
339
|
+
checksum = "sha256:4a071fc6bcf3cd6eca70981b172cf0f0e25ba8caa286daddaf4303576172f9bd"
|
|
340
|
+
checksum_source = "mise-versions"
|
|
341
|
+
url = "https://github.com/sharkdp/bat/releases/download/v0.27.0/bat-v0.27.0-aarch64-unknown-linux-musl.tar.gz"
|
|
342
|
+
url_api = "https://api.github.com/repos/sharkdp/bat/releases/assets/803660755"
|
|
337
343
|
|
|
338
344
|
[tools.bat."platforms.linux-x64"]
|
|
339
|
-
checksum = "sha256:
|
|
345
|
+
checksum = "sha256:0ac86f417ef02d5dc07ac641c84ee979d3781a6482656fa957b3803737955223"
|
|
346
|
+
checksum_source = "mise-versions"
|
|
347
|
+
url = "https://github.com/sharkdp/bat/releases/download/v0.27.0/bat-v0.27.0-x86_64-unknown-linux-gnu.tar.gz"
|
|
348
|
+
url_api = "https://api.github.com/repos/sharkdp/bat/releases/assets/803662118"
|
|
349
|
+
|
|
350
|
+
[tools.bat."platforms.linux-x64-baseline"]
|
|
351
|
+
checksum = "sha256:0ac86f417ef02d5dc07ac641c84ee979d3781a6482656fa957b3803737955223"
|
|
352
|
+
checksum_source = "mise-versions"
|
|
353
|
+
url = "https://github.com/sharkdp/bat/releases/download/v0.27.0/bat-v0.27.0-x86_64-unknown-linux-gnu.tar.gz"
|
|
354
|
+
url_api = "https://api.github.com/repos/sharkdp/bat/releases/assets/803662118"
|
|
355
|
+
|
|
356
|
+
[tools.bat."platforms.linux-x64-musl"]
|
|
357
|
+
checksum = "sha256:350b244087c555d316f82c3c2ee45e3273b4dac2530890be892452eb8aa3d22c"
|
|
340
358
|
checksum_source = "mise-versions"
|
|
341
|
-
url = "https://github.com/sharkdp/bat/releases/download/v0.
|
|
342
|
-
url_api = "https://api.github.com/repos/sharkdp/bat/releases/assets/
|
|
359
|
+
url = "https://github.com/sharkdp/bat/releases/download/v0.27.0/bat-v0.27.0-x86_64-unknown-linux-musl.tar.gz"
|
|
360
|
+
url_api = "https://api.github.com/repos/sharkdp/bat/releases/assets/803660760"
|
|
361
|
+
|
|
362
|
+
[tools.bat."platforms.linux-x64-musl-baseline"]
|
|
363
|
+
checksum = "sha256:350b244087c555d316f82c3c2ee45e3273b4dac2530890be892452eb8aa3d22c"
|
|
364
|
+
checksum_source = "mise-versions"
|
|
365
|
+
url = "https://github.com/sharkdp/bat/releases/download/v0.27.0/bat-v0.27.0-x86_64-unknown-linux-musl.tar.gz"
|
|
366
|
+
url_api = "https://api.github.com/repos/sharkdp/bat/releases/assets/803660760"
|
|
343
367
|
|
|
344
368
|
[tools.bat."platforms.macos-arm64"]
|
|
345
|
-
checksum = "sha256:
|
|
369
|
+
checksum = "sha256:3bd50d70e1a2c52c57b4ffaaee3113595ec970604bf1b4e2e0992e3e1752c23b"
|
|
346
370
|
checksum_source = "mise-versions"
|
|
347
|
-
url = "https://github.com/sharkdp/bat/releases/download/v0.
|
|
348
|
-
url_api = "https://api.github.com/repos/sharkdp/bat/releases/assets/
|
|
371
|
+
url = "https://github.com/sharkdp/bat/releases/download/v0.27.0/bat-v0.27.0-aarch64-apple-darwin.tar.gz"
|
|
372
|
+
url_api = "https://api.github.com/repos/sharkdp/bat/releases/assets/803663887"
|
|
349
373
|
|
|
350
374
|
[tools.bat."platforms.macos-x64"]
|
|
351
|
-
checksum = "sha256:
|
|
375
|
+
checksum = "sha256:29029a4aaecef1ec873aa319047bf70803026bd3eaff664011fff650f73355f9"
|
|
376
|
+
checksum_source = "mise-versions"
|
|
377
|
+
url = "https://github.com/sharkdp/bat/releases/download/v0.27.0/bat-v0.27.0-x86_64-apple-darwin.tar.gz"
|
|
378
|
+
url_api = "https://api.github.com/repos/sharkdp/bat/releases/assets/803676239"
|
|
379
|
+
|
|
380
|
+
[tools.bat."platforms.macos-x64-baseline"]
|
|
381
|
+
checksum = "sha256:29029a4aaecef1ec873aa319047bf70803026bd3eaff664011fff650f73355f9"
|
|
352
382
|
checksum_source = "mise-versions"
|
|
353
|
-
url = "https://github.com/sharkdp/bat/releases/download/v0.
|
|
354
|
-
url_api = "https://api.github.com/repos/sharkdp/bat/releases/assets/
|
|
383
|
+
url = "https://github.com/sharkdp/bat/releases/download/v0.27.0/bat-v0.27.0-x86_64-apple-darwin.tar.gz"
|
|
384
|
+
url_api = "https://api.github.com/repos/sharkdp/bat/releases/assets/803676239"
|
|
355
385
|
|
|
356
386
|
[tools.bat."platforms.windows-x64"]
|
|
357
|
-
checksum = "sha256:
|
|
387
|
+
checksum = "sha256:3c0b0a9765bd4679de82a1f2772c522025eea5a1de5f7b97c6fa119c25721b1b"
|
|
388
|
+
checksum_source = "mise-versions"
|
|
389
|
+
url = "https://github.com/sharkdp/bat/releases/download/v0.27.0/bat-v0.27.0-x86_64-pc-windows-msvc.zip"
|
|
390
|
+
url_api = "https://api.github.com/repos/sharkdp/bat/releases/assets/803668054"
|
|
391
|
+
|
|
392
|
+
[tools.bat."platforms.windows-x64-baseline"]
|
|
393
|
+
checksum = "sha256:3c0b0a9765bd4679de82a1f2772c522025eea5a1de5f7b97c6fa119c25721b1b"
|
|
358
394
|
checksum_source = "mise-versions"
|
|
359
|
-
url = "https://github.com/sharkdp/bat/releases/download/v0.
|
|
360
|
-
url_api = "https://api.github.com/repos/sharkdp/bat/releases/assets/
|
|
395
|
+
url = "https://github.com/sharkdp/bat/releases/download/v0.27.0/bat-v0.27.0-x86_64-pc-windows-msvc.zip"
|
|
396
|
+
url_api = "https://api.github.com/repos/sharkdp/bat/releases/assets/803668054"
|
|
361
397
|
|
|
362
398
|
[[tools.bun]]
|
|
363
399
|
version = "1.4.5"
|
package/mise.toml
CHANGED
|
@@ -39,7 +39,7 @@ ripgrep = "16.0.0"
|
|
|
39
39
|
tmux = { version = "3.8", os = ["linux", "macos"] }
|
|
40
40
|
fd = "10.5.2"
|
|
41
41
|
fzf = "0.75.0"
|
|
42
|
-
bat = "0.
|
|
42
|
+
bat = "0.27.0"
|
|
43
43
|
delta = "0.22.0"
|
|
44
44
|
git-lfs = "3.8.1"
|
|
45
45
|
docker-cli = "29.10.1"
|
|
@@ -107,16 +107,16 @@ mise_macos_x64_sha256 = "19c0e3dff9eddaab7a3519e9556be35580ade53b2bffb550f307343
|
|
|
107
107
|
mise_macos_arm64_sha256 = "f7bd19aa4e6b7a58d7296f98e2c6af68b2e2643dfd608b0bc46c2b5fdbc8749b"
|
|
108
108
|
# Official native server distribution (Ubuntu workers, and the manager's
|
|
109
109
|
# pinned CLI); bootstrap/native-t3.ts owns installation. From the release's SHA256SUMS.
|
|
110
|
-
t3_version = "0.1.
|
|
111
|
-
t3_linux_x64_sha256 = "
|
|
112
|
-
t3_linux_arm64_sha256 = "
|
|
113
|
-
t3_darwin_arm64_sha256 = "
|
|
110
|
+
t3_version = "0.1.14-nightly.20261128.5372"
|
|
111
|
+
t3_linux_x64_sha256 = "ed47136d5696a6933038d0a6716e60269c5030bb2b64fae277c13d8e9d1b3022"
|
|
112
|
+
t3_linux_arm64_sha256 = "9cb327604bd56ad997b6827913ad292010f7f66da171ce8a9b46392a0a0d3ba5"
|
|
113
|
+
t3_darwin_arm64_sha256 = "a760a18dc24a6c49aa77e37d5a11c199897eb77295feffd14da40efa0fde70b9"
|
|
114
114
|
# Official T3 Code desktop .deb (same release). Workers run this GUI app as their
|
|
115
115
|
# only T3 process; it embeds the server. Upstream SHA256SUMS omits .deb files,
|
|
116
116
|
# so these digests were computed from the release assets.
|
|
117
|
-
t3_desktop_darwin_arm64_sha256 = "
|
|
118
|
-
t3_desktop_amd64_sha256 = "
|
|
119
|
-
t3_desktop_arm64_sha256 = "
|
|
117
|
+
t3_desktop_darwin_arm64_sha256 = "7b3b7003cf4cf23e684437e34c5536b82a2d84319d335e08b32e4134b6b8f2a9"
|
|
118
|
+
t3_desktop_amd64_sha256 = "ada83b8c7991fe04889fd163b70c33b11098856e1ffae1dd72b9f2e03fdc1bab"
|
|
119
|
+
t3_desktop_arm64_sha256 = "ab899391c7174d6990efb0de9d68472a2fc93c3ecc937d915b5ab789f765e92a"
|
|
120
120
|
# Official AWS v2 Windows MSI, same version as tools.aws; checked before execution.
|
|
121
121
|
aws_windows_msi_sha256 = "65b82923074b154e3ec5375716b886e3c5bd5483714cc94ba1e67a04dfbb6715"
|
|
122
122
|
# Docker Desktop supplies the macOS engine, Compose and Buildx as one vendor bundle.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@crvouga/homelab",
|
|
3
|
-
"version": "0.23.
|
|
3
|
+
"version": "0.23.2",
|
|
4
4
|
"description": "Keeps a set of development machines in sync: one manager and many workers",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": "github:crvouga/homelab",
|
|
@@ -73,5 +73,5 @@
|
|
|
73
73
|
"engines": {
|
|
74
74
|
"node": ">=22"
|
|
75
75
|
},
|
|
76
|
-
"gitHead": "
|
|
76
|
+
"gitHead": "9d33aa8771d5abe9d8269e693b7ab166335e39f6"
|
|
77
77
|
}
|
package/schema/check-ids.json
CHANGED
|
@@ -1832,14 +1832,6 @@
|
|
|
1832
1832
|
"manual": "Approve first T3 pairing in interactive converge or with t3.pairOnEnrollment; a replaced worker is paired by replace or the next converge, and converge applies the rest."
|
|
1833
1833
|
}
|
|
1834
1834
|
},
|
|
1835
|
-
{
|
|
1836
|
-
"id": "t3:quota-coverage",
|
|
1837
|
-
"meaning": "The manager reads quota windows for each managed Antigravity account from its proxy.",
|
|
1838
|
-
"severity": "required",
|
|
1839
|
-
"repair": {
|
|
1840
|
-
"manual": "Approve first T3 pairing in interactive converge or with t3.pairOnEnrollment; a replaced worker is paired by replace or the next converge, and converge applies the rest."
|
|
1841
|
-
}
|
|
1842
|
-
},
|
|
1843
1835
|
{
|
|
1844
1836
|
"id": "t3:reconciliation",
|
|
1845
1837
|
"meaning": "T3 reconciliation can read and validate its local inputs.",
|
package/src/check-registry.ts
CHANGED
|
@@ -438,8 +438,6 @@ export const CHECK_MEANINGS: Record<string, string> = {
|
|
|
438
438
|
'The proxy account roster can be read without changing providers.',
|
|
439
439
|
't3:reconciliation':
|
|
440
440
|
'T3 reconciliation can read and validate its local inputs.',
|
|
441
|
-
't3:quota-coverage':
|
|
442
|
-
'The manager reads quota windows for each managed Antigravity account from its proxy.',
|
|
443
441
|
't3:providers': "T3's provider instances are the declared ones.",
|
|
444
442
|
't3:running-version':
|
|
445
443
|
'The running T3 server is the installed release and no restart of it is pending; a pending restart waits for running agent turns, until its deadline.',
|
|
@@ -7,7 +7,6 @@ import { toolchainChecks } from '../toolchain-checks';
|
|
|
7
7
|
import { pinnedT3Version, versionCheck } from '../t3/version';
|
|
8
8
|
import { liveServerVersion } from '../platform/t3-service';
|
|
9
9
|
import { loopbackOrigin } from '../t3/local-rpc';
|
|
10
|
-
import { managerQuotaCoverage } from '../t3/quota-coverage';
|
|
11
10
|
import { quotaLimited, verifyFleetProviders } from '../agents/fleet-verify';
|
|
12
11
|
import { verifyNativeAgents } from '../agents/native-verify';
|
|
13
12
|
import { accountContext, nodeAccountChecks } from '../accounts/context';
|
|
@@ -267,12 +266,7 @@ async function managerSessions(
|
|
|
267
266
|
})
|
|
268
267
|
)
|
|
269
268
|
);
|
|
270
|
-
return [
|
|
271
|
-
...providers,
|
|
272
|
-
...roster,
|
|
273
|
-
...sessions,
|
|
274
|
-
...(await managerQuotaCoverage(accounts?.live ?? [], run)),
|
|
275
|
-
];
|
|
269
|
+
return [...providers, ...roster, ...sessions];
|
|
276
270
|
}
|
|
277
271
|
|
|
278
272
|
function playbookPassed(cached: boolean): Check {
|
package/src/t3/local-rpc.ts
CHANGED
|
@@ -147,18 +147,6 @@ const webTransport: T3Transport = {
|
|
|
147
147
|
socket.onmessage = (event) => {
|
|
148
148
|
try {
|
|
149
149
|
const reply: unknown = JSON.parse(String(event.data));
|
|
150
|
-
if (
|
|
151
|
-
record(message) &&
|
|
152
|
-
message['tag'] === 'subscribeServerConfig' &&
|
|
153
|
-
record(reply) &&
|
|
154
|
-
reply['requestId'] === id &&
|
|
155
|
-
reply['_tag'] === 'Chunk'
|
|
156
|
-
) {
|
|
157
|
-
const sources = quotaUpdate(reply['values']);
|
|
158
|
-
if (sources) end(sources);
|
|
159
|
-
else socket.send(JSON.stringify({ _tag: 'Ack', requestId: id }));
|
|
160
|
-
return;
|
|
161
|
-
}
|
|
162
150
|
if (
|
|
163
151
|
record(reply) &&
|
|
164
152
|
reply['_tag'] === 'Exit' &&
|
|
@@ -174,25 +162,3 @@ const webTransport: T3Transport = {
|
|
|
174
162
|
});
|
|
175
163
|
},
|
|
176
164
|
};
|
|
177
|
-
|
|
178
|
-
function quotaUpdate(values: unknown): unknown[] | undefined {
|
|
179
|
-
if (!Array.isArray(values)) return;
|
|
180
|
-
for (const event of values) {
|
|
181
|
-
if (!record(event)) continue;
|
|
182
|
-
const config = event['config'];
|
|
183
|
-
if (
|
|
184
|
-
event['type'] === 'snapshot' &&
|
|
185
|
-
record(config) &&
|
|
186
|
-
Array.isArray(config['usageLimitSources'])
|
|
187
|
-
)
|
|
188
|
-
return config['usageLimitSources'];
|
|
189
|
-
const payload = event['payload'];
|
|
190
|
-
if (
|
|
191
|
-
event['type'] === 'usageLimitSourcesUpdated' &&
|
|
192
|
-
record(payload) &&
|
|
193
|
-
Array.isArray(payload['sources'])
|
|
194
|
-
)
|
|
195
|
-
return payload['sources'];
|
|
196
|
-
}
|
|
197
|
-
return undefined;
|
|
198
|
-
}
|
package/src/t3/quota-coverage.ts
DELETED
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
import { record } from '../config';
|
|
2
|
-
import type { Check, Runner } from '../types';
|
|
3
|
-
import type { Account } from '../agents/accounts';
|
|
4
|
-
import { registry } from '../agents/registry';
|
|
5
|
-
import { localRpc } from './local-rpc';
|
|
6
|
-
|
|
7
|
-
export async function managerQuotaCoverage(
|
|
8
|
-
accounts: Account[],
|
|
9
|
-
run: Runner
|
|
10
|
-
): Promise<Check[]> {
|
|
11
|
-
const managed = accounts.filter((account) => account.tool === 'antigravity');
|
|
12
|
-
if (!managed.length) return [];
|
|
13
|
-
const sources = await localRpc(
|
|
14
|
-
run,
|
|
15
|
-
{ tag: 'subscribeServerConfig', payload: { usageLimitSources: true } },
|
|
16
|
-
[
|
|
17
|
-
'--scope',
|
|
18
|
-
'orchestration:read',
|
|
19
|
-
'--ttl',
|
|
20
|
-
'2m',
|
|
21
|
-
'--label',
|
|
22
|
-
'homelab quota check',
|
|
23
|
-
]
|
|
24
|
-
);
|
|
25
|
-
return [quotaCoverage(managed, registry.proxy.endpoint, sources)];
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
function fresh(value: unknown, now: number) {
|
|
29
|
-
const age = typeof value === 'string' ? now - Date.parse(value) : NaN;
|
|
30
|
-
return age >= 0 && age <= 15 * 60_000;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
function accountKeys(account: unknown, now: number): string[] {
|
|
34
|
-
if (!record(account) || account['driver'] !== 'antigravity') return [];
|
|
35
|
-
const limits = account['usageLimits'];
|
|
36
|
-
if (
|
|
37
|
-
!record(limits) ||
|
|
38
|
-
limits['unavailable'] ||
|
|
39
|
-
!fresh(limits['checkedAt'], now) ||
|
|
40
|
-
!Array.isArray(limits['windows']) ||
|
|
41
|
-
!limits['windows'].length
|
|
42
|
-
)
|
|
43
|
-
return [];
|
|
44
|
-
return [account['email'], account['id']]
|
|
45
|
-
.filter((key): key is string => typeof key === 'string')
|
|
46
|
-
.map((key) => key.replace(/\.json$/i, '').toLowerCase());
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
function matches(source: unknown, endpoint: string, now: number): unknown[] {
|
|
50
|
-
if (
|
|
51
|
-
!record(source) ||
|
|
52
|
-
source['kind'] !== 'cliproxy' ||
|
|
53
|
-
source['error'] ||
|
|
54
|
-
!fresh(source['checkedAt'], now)
|
|
55
|
-
)
|
|
56
|
-
return [];
|
|
57
|
-
const authority = source['endpoint'] ?? source['origin'];
|
|
58
|
-
return typeof authority === 'string' &&
|
|
59
|
-
authority.replace(/\/$/, '') === endpoint.replace(/\/$/, '') &&
|
|
60
|
-
Array.isArray(source['accounts'])
|
|
61
|
-
? source['accounts']
|
|
62
|
-
: [];
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
export function quotaCoverage(
|
|
66
|
-
accounts: Account[],
|
|
67
|
-
endpoint: string,
|
|
68
|
-
sources: unknown,
|
|
69
|
-
now = Date.now()
|
|
70
|
-
): Check {
|
|
71
|
-
const covered = new Set(
|
|
72
|
-
Array.isArray(sources)
|
|
73
|
-
? sources
|
|
74
|
-
.flatMap((source) => matches(source, endpoint, now))
|
|
75
|
-
.flatMap((account) => accountKeys(account, now))
|
|
76
|
-
: []
|
|
77
|
-
);
|
|
78
|
-
const missing = accounts.flatMap((account, i) =>
|
|
79
|
-
covered.has(account.email.toLowerCase()) ||
|
|
80
|
-
covered.has(account.prefix.toLowerCase())
|
|
81
|
-
? []
|
|
82
|
-
: [i + 1]
|
|
83
|
-
);
|
|
84
|
-
const id = 't3:quota-coverage';
|
|
85
|
-
return missing.length
|
|
86
|
-
? {
|
|
87
|
-
id,
|
|
88
|
-
status: 'warn',
|
|
89
|
-
summary: `T3_QUOTA_COVERAGE_MISSING: account positions ${missing.join(', ')} of ${accounts.length}.`,
|
|
90
|
-
remedy: {
|
|
91
|
-
action:
|
|
92
|
-
'Run homelab accounts on the manager. For a usable account, refresh the CLI proxy usage-limit source in T3 Settings on the manager. For needs-login, renew the account on the manager using the approved sign-in method for its plan. Then rerun converge.',
|
|
93
|
-
},
|
|
94
|
-
}
|
|
95
|
-
: {
|
|
96
|
-
id,
|
|
97
|
-
status: 'pass',
|
|
98
|
-
summary: `The manager's CLI proxy quota source reports windows for all ${accounts.length} managed Antigravity accounts.`,
|
|
99
|
-
};
|
|
100
|
-
}
|