@gaia-ai/gaia 0.15.1 → 0.15.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.
Files changed (2) hide show
  1. package/dist/src/config.js +55 -1
  2. package/package.json +24 -24
@@ -309,8 +309,46 @@ function buildConfigCommand(parent, operation, deps, hiddenScope, description) {
309
309
  report.verification = current.verification;
310
310
  }
311
311
  }
312
+ // A device-code connection authenticates from a session that sign-in
313
+ // creates, and nothing has signed in yet when `init` has only just
314
+ // written the file. Verifying here therefore reports
315
+ // `authentication_failure` on a perfectly correct machine — a symptom
316
+ // named in place of its cause, and the reason `gaia init` used to end
317
+ // `failed` on every fresh setup. Writing the connection and signing in
318
+ // are two steps, so `init` reports the second as outstanding instead.
319
+ // An explicit `--online` still verifies, so the deferral is gated on
320
+ // the whole predicate rather than on the file read alone — otherwise
321
+ // `--auth-type device` defers the very check the operator asked for.
322
+ // Read the grant off the connection that is about to be verified, not
323
+ // off `--auth-type`: a repeat `gaia init` supplies no flag and writes
324
+ // nothing, and keying on the input would leave exactly that run — the
325
+ // one an operator uses as a diagnostic — reporting a failure again. A
326
+ // read that fails falls through to verifying, so a broken file is
327
+ // reported rather than quietly skipped.
328
+ let connectionGrant;
329
+ if (operation === 'init' && planning.connectionPath)
330
+ try {
331
+ const fields = await reportLoadedGaiaConfigFields(planning.connectionPath);
332
+ // Locate the OAuth plugin by identity. Its grant is the only one
333
+ // that says anything about signing in, and any plugin may carry a
334
+ // `with.type` of its own, so matching on field shape alone reads
335
+ // whichever happens to come first.
336
+ const prefix = fields
337
+ .find((field) => /^plugins\[\d+\]\.plugin$/.test(field.key) &&
338
+ field.value === '@dropsh/plugin-oauth2')
339
+ ?.key.replace(/\.plugin$/, '');
340
+ if (prefix !== undefined)
341
+ connectionGrant = fields.find((field) => field.key === `${prefix}.with.type`)?.value;
342
+ }
343
+ catch {
344
+ // Inventory findings already describe an unreadable or malformed file.
345
+ }
346
+ const awaitsSignIn = !options.online &&
347
+ (inputs.authType === 'oauth2_device_code' ||
348
+ connectionGrant === 'oauth2_device_code');
312
349
  if (!cancelled &&
313
350
  !options.dryRun &&
351
+ !awaitsSignIn &&
314
352
  (operation === 'init' || options.online) &&
315
353
  !report.findings.some((f) => f.severity === 'error')) {
316
354
  const { verifyConfigConnections } = await import('@gaia-ai/core');
@@ -332,7 +370,23 @@ function buildConfigCommand(parent, operation, deps, hiddenScope, description) {
332
370
  else if (!options.dryRun &&
333
371
  (operation === 'init' || options.online) &&
334
372
  report.verification.online.status !== 'not_applicable') {
335
- const reason = 'Online validation skipped because offline errors require repair or input was cancelled.';
373
+ // `gaia init` is also the diagnostic an operator re-runs on a finished
374
+ // setup. Naming sign-in as the next step there is the one instruction
375
+ // that is certainly wrong, so say which of the two situations this is.
376
+ const { hasStoredGaiaSession } = await import('@gaia-ai/core');
377
+ const reason = awaitsSignIn
378
+ ? (await hasStoredGaiaSession(deps.host ?? {
379
+ resolveBases: [import.meta.url, pathToFileURL(`${cwd}/`).href],
380
+ }, {
381
+ cwd,
382
+ ...(planning.connectionPath
383
+ ? { explicit: planning.connectionPath }
384
+ : {}),
385
+ ...(deps.stateDir ? { stateDir: deps.stateDir } : {}),
386
+ }))
387
+ ? 'A session for this connection already exists; verify it with gaia config check --scope connection --online.'
388
+ : 'Sign-in is the next step: run gaia dropsh auth login, then gaia config check --scope connection --online.'
389
+ : 'Online validation skipped because offline errors require repair or input was cancelled.';
336
390
  report.verification.online.reason = reason;
337
391
  report.verification.skipped.push({
338
392
  path: report.roots.connection,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gaia-ai/gaia",
3
- "version": "0.15.1",
3
+ "version": "0.15.2",
4
4
  "description": "GAIA meta package: the `gaia` plugin-host CLI + all runtime plugins. Global install target.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -38,29 +38,29 @@
38
38
  "jsonapi"
39
39
  ],
40
40
  "dependencies": {
41
- "@gaia-ai/addon-agents": "^0.15.1",
42
- "@gaia-ai/addon-auth-basic": "^0.15.1",
43
- "@gaia-ai/addon-claude": "^0.15.1",
44
- "@gaia-ai/addon-codex": "^0.15.1",
45
- "@gaia-ai/addon-deployment": "^0.15.1",
46
- "@gaia-ai/addon-dropsh": "^0.15.1",
47
- "@gaia-ai/addon-essentials": "^0.15.1",
48
- "@gaia-ai/addon-gaia-ui": "^0.15.1",
49
- "@gaia-ai/addon-gaia-ui-artifacts": "^0.15.1",
50
- "@gaia-ai/addon-grok": "^0.15.1",
51
- "@gaia-ai/addon-herdr": "^0.15.1",
52
- "@gaia-ai/addon-info": "^0.15.1",
53
- "@gaia-ai/addon-kimi": "^0.15.1",
54
- "@gaia-ai/addon-opencode": "^0.15.1",
55
- "@gaia-ai/addon-pi": "^0.15.1",
56
- "@gaia-ai/addon-ports": "^0.15.1",
57
- "@gaia-ai/addon-ports-ui": "^0.15.1",
58
- "@gaia-ai/addon-remote-drupal": "^0.15.1",
59
- "@gaia-ai/addon-workspace": "^0.15.1",
60
- "@gaia-ai/addon-workspace-git": "^0.15.1",
61
- "@gaia-ai/conductor": "^0.15.1",
62
- "@gaia-ai/core": "^0.15.1",
63
- "@gaia-ai/ui": "^0.15.1",
41
+ "@gaia-ai/addon-agents": "^0.15.2",
42
+ "@gaia-ai/addon-auth-basic": "^0.15.2",
43
+ "@gaia-ai/addon-claude": "^0.15.2",
44
+ "@gaia-ai/addon-codex": "^0.15.2",
45
+ "@gaia-ai/addon-deployment": "^0.15.2",
46
+ "@gaia-ai/addon-dropsh": "^0.15.2",
47
+ "@gaia-ai/addon-essentials": "^0.15.2",
48
+ "@gaia-ai/addon-gaia-ui": "^0.15.2",
49
+ "@gaia-ai/addon-gaia-ui-artifacts": "^0.15.2",
50
+ "@gaia-ai/addon-grok": "^0.15.2",
51
+ "@gaia-ai/addon-herdr": "^0.15.2",
52
+ "@gaia-ai/addon-info": "^0.15.2",
53
+ "@gaia-ai/addon-kimi": "^0.15.2",
54
+ "@gaia-ai/addon-opencode": "^0.15.2",
55
+ "@gaia-ai/addon-pi": "^0.15.2",
56
+ "@gaia-ai/addon-ports": "^0.15.2",
57
+ "@gaia-ai/addon-ports-ui": "^0.15.2",
58
+ "@gaia-ai/addon-remote-drupal": "^0.15.2",
59
+ "@gaia-ai/addon-workspace": "^0.15.2",
60
+ "@gaia-ai/addon-workspace-git": "^0.15.2",
61
+ "@gaia-ai/conductor": "^0.15.2",
62
+ "@gaia-ai/core": "^0.15.2",
63
+ "@gaia-ai/ui": "^0.15.2",
64
64
  "commander": "^12.1.0"
65
65
  }
66
66
  }