@crvouga/homelab 0.22.0 → 0.23.0
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/bootstrap/npm.ts +10 -3
- package/docs/accounts.md +30 -0
- package/package.json +2 -2
- package/src/cli/fleet-accounts.ts +40 -0
- package/src/cli/register-fleet.ts +4 -0
- package/src/t3/quota-coverage.ts +1 -1
package/bootstrap/npm.ts
CHANGED
|
@@ -124,11 +124,12 @@ export function measure(
|
|
|
124
124
|
const whoami = exec.capture(['npm', 'whoami']);
|
|
125
125
|
const tag = `v${version}`;
|
|
126
126
|
const view = exec.capture(['npm', 'view', `${name}@${version}`, 'gitHead']);
|
|
127
|
-
const any = exec.capture(['npm', 'view', name, '
|
|
127
|
+
const any = exec.capture(['npm', 'view', name, 'version']);
|
|
128
128
|
if (!any.ok && !/E404/.test(any.stderr))
|
|
129
129
|
throw new Error('Could not reach the npm registry. Check the network.');
|
|
130
|
-
|
|
131
|
-
const
|
|
130
|
+
// npm can reserve the package name with a placeholder while the seed is absent.
|
|
131
|
+
const published = view.ok || (any.ok && any.stdout.trim() !== '0.0.0-stage');
|
|
132
|
+
const trust = any.ok
|
|
132
133
|
? exec.capture(['npm', 'trust', 'list', name, '--json'])
|
|
133
134
|
: null;
|
|
134
135
|
const configs = trust?.ok ? trustConfigs(trust.stdout) : [];
|
|
@@ -351,6 +352,12 @@ export async function bootstrap(
|
|
|
351
352
|
return 1;
|
|
352
353
|
}
|
|
353
354
|
state = measure(exec, target, version);
|
|
355
|
+
if (step.id === 'publish' && !state.published) {
|
|
356
|
+
log(
|
|
357
|
+
'npm accepted the seed. Wait for it to appear in the registry, then run bun run bootstrap again.'
|
|
358
|
+
);
|
|
359
|
+
return 1;
|
|
360
|
+
}
|
|
354
361
|
}
|
|
355
362
|
show(deps, state, plan(state, version));
|
|
356
363
|
return plan(state, version).every((step) => step.done) ? 0 : 1;
|
package/docs/accounts.md
CHANGED
|
@@ -118,6 +118,36 @@ otherwise.
|
|
|
118
118
|
its tool's preferred defaults (it then starts on its first model by name) or
|
|
119
119
|
nothing of T3's catalogue.
|
|
120
120
|
|
|
121
|
+
## When T3 asks for sign-in on several machines
|
|
122
|
+
|
|
123
|
+
Start on the manager, in the project that pins homelab. To list the sign-ins
|
|
124
|
+
that need attention across providers, run:
|
|
125
|
+
|
|
126
|
+
```sh
|
|
127
|
+
npx @crvouga/homelab accounts --auth-plan --json
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
If the command reports an error or the roster is unavailable, resolve that
|
|
131
|
+
before interpreting an empty list. For each result, check the current account
|
|
132
|
+
label with `homelab accounts` before renewing it. Use the provider's documented
|
|
133
|
+
sign-in method for the client, account plan and intended use. Where the
|
|
134
|
+
provider permits proxy access, renew the account once on the manager using
|
|
135
|
+
the command below. Complete consent and any MFA yourself. Homelab then
|
|
136
|
+
propagates the instance configuration to the workers. Where the provider
|
|
137
|
+
requires its own client, complete its sign-in there. A successful proxy login
|
|
138
|
+
alone does not establish permission to use a subscription through a proxy.
|
|
139
|
+
|
|
140
|
+
For Antigravity, “Sign in with Google to see Antigravity limits” is a prompt
|
|
141
|
+
from the limits display. If the roster shows the account as usable, check
|
|
142
|
+
the CLI proxy usage-limit source in T3 Settings on the manager and refresh
|
|
143
|
+
it. Run `homelab converge` and look for `t3:quota-coverage`, which checks for
|
|
144
|
+
recent quota windows for every managed Antigravity account. A passing check
|
|
145
|
+
covers the manager's source. Individual native clients can still request
|
|
146
|
+
their own sign-in. If you need that native view, follow the prompt in that
|
|
147
|
+
client, including starting a turn if it asks you to renew an expired session.
|
|
148
|
+
Keep browser sessions, OAuth tokens and device codes on the machine or in
|
|
149
|
+
the provider flow that issued them.
|
|
150
|
+
|
|
121
151
|
## Adding, signing in again, removing
|
|
122
152
|
|
|
123
153
|
```sh
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@crvouga/homelab",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.23.0",
|
|
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": "89832749bb32eaffe2f32c804d158d6b69ec88e2"
|
|
77
77
|
}
|
|
@@ -20,6 +20,7 @@ import type { Settings } from './settings';
|
|
|
20
20
|
import { fleetSync } from './fleet-sync';
|
|
21
21
|
|
|
22
22
|
export interface FleetAccountsOptions {
|
|
23
|
+
authPlan?: boolean;
|
|
23
24
|
diff?: boolean;
|
|
24
25
|
add?: boolean;
|
|
25
26
|
relogin?: boolean;
|
|
@@ -51,6 +52,7 @@ export async function fleetAccounts(
|
|
|
51
52
|
settings: Settings,
|
|
52
53
|
dependencies: AccountsDependencies = {}
|
|
53
54
|
): Promise<CommandOutcome> {
|
|
55
|
+
if (options.authPlan) return authPlan(options, args, settings, dependencies);
|
|
54
56
|
const home = dependencies.home ?? homedir();
|
|
55
57
|
if (options.removeNativeLogins)
|
|
56
58
|
return removeNativeLogins(Boolean(options.yes), home);
|
|
@@ -62,6 +64,44 @@ export async function fleetAccounts(
|
|
|
62
64
|
return report(options, settings, dependencies, { change, changed });
|
|
63
65
|
}
|
|
64
66
|
|
|
67
|
+
async function authPlan(
|
|
68
|
+
options: FleetAccountsOptions,
|
|
69
|
+
args: string[],
|
|
70
|
+
settings: Settings,
|
|
71
|
+
dependencies: AccountsDependencies
|
|
72
|
+
): Promise<CommandOutcome> {
|
|
73
|
+
if (
|
|
74
|
+
args.length ||
|
|
75
|
+
options.add ||
|
|
76
|
+
options.relogin ||
|
|
77
|
+
options.remove ||
|
|
78
|
+
options.removeNativeLogins ||
|
|
79
|
+
options.diff ||
|
|
80
|
+
options.yes
|
|
81
|
+
)
|
|
82
|
+
throw new FleetUsageError('Run --auth-plan on its own.');
|
|
83
|
+
const roster = await readRoster(
|
|
84
|
+
dependencies.run ?? runCommand,
|
|
85
|
+
settings.workspace
|
|
86
|
+
);
|
|
87
|
+
return {
|
|
88
|
+
exitCode: roster.managementApi ? 0 : 1,
|
|
89
|
+
data: {
|
|
90
|
+
version: 1,
|
|
91
|
+
command: 'accounts',
|
|
92
|
+
ok: roster.managementApi,
|
|
93
|
+
managementApi: roster.managementApi,
|
|
94
|
+
signIns: roster.accounts
|
|
95
|
+
.filter((account) => account.state === 'needs-login')
|
|
96
|
+
.map(({ provider, index }) => ({ provider, index })),
|
|
97
|
+
...(!roster.managementApi && {
|
|
98
|
+
summary:
|
|
99
|
+
'The proxy management API is unavailable. The sign-in plan may be incomplete.',
|
|
100
|
+
}),
|
|
101
|
+
},
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
|
|
65
105
|
async function report(
|
|
66
106
|
options: FleetAccountsOptions,
|
|
67
107
|
settings: Settings,
|
|
@@ -669,6 +669,10 @@ function registerAccounts({ program, defaults, complete }: Registration) {
|
|
|
669
669
|
'accounts [args...]',
|
|
670
670
|
'List the provider accounts signed in on the CLI proxy and their state; add, sign in again or remove one'
|
|
671
671
|
)
|
|
672
|
+
.option(
|
|
673
|
+
'--auth-plan',
|
|
674
|
+
'List the provider accounts that require a sign-in on the manager'
|
|
675
|
+
)
|
|
672
676
|
.option('--diff', 'Also compare what this machine offers with the roster')
|
|
673
677
|
.option('--add', 'Sign a new account in: --add PROVIDER')
|
|
674
678
|
.option('--relogin', 'Sign one account in again: --relogin PROVIDER INDEX')
|
package/src/t3/quota-coverage.ts
CHANGED
|
@@ -89,7 +89,7 @@ export function quotaCoverage(
|
|
|
89
89
|
summary: `T3_QUOTA_COVERAGE_MISSING: account positions ${missing.join(', ')} of ${accounts.length}.`,
|
|
90
90
|
remedy: {
|
|
91
91
|
action:
|
|
92
|
-
'
|
|
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
93
|
},
|
|
94
94
|
}
|
|
95
95
|
: {
|