@phnx-labs/agents-cli 1.22.3 → 1.22.5

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 (49) hide show
  1. package/CHANGELOG.md +48 -0
  2. package/dist/bin/agents +0 -0
  3. package/dist/commands/events.js +8 -0
  4. package/dist/commands/exec.js +7 -5
  5. package/dist/commands/inspect.js +18 -5
  6. package/dist/commands/models.d.ts +1 -1
  7. package/dist/commands/models.js +68 -9
  8. package/dist/commands/view.d.ts +12 -0
  9. package/dist/commands/view.js +2 -0
  10. package/dist/commands/webhook.js +8 -4
  11. package/dist/lib/browser/chrome.d.ts +12 -0
  12. package/dist/lib/browser/chrome.js +27 -11
  13. package/dist/lib/cloud/antigravity.js +8 -2
  14. package/dist/lib/crabbox/cli.d.ts +2 -0
  15. package/dist/lib/crabbox/cli.js +109 -39
  16. package/dist/lib/event-stream.d.ts +3 -0
  17. package/dist/lib/event-stream.js +5 -0
  18. package/dist/lib/events.d.ts +2 -0
  19. package/dist/lib/events.js +6 -1
  20. package/dist/lib/feed.d.ts +1 -1
  21. package/dist/lib/feed.js +19 -0
  22. package/dist/lib/menubar/MenubarHelper.app/Contents/CodeResources +0 -0
  23. package/dist/lib/menubar/MenubarHelper.app/Contents/MacOS/MenubarHelper +0 -0
  24. package/dist/lib/model-tier-overrides.d.ts +43 -0
  25. package/dist/lib/model-tier-overrides.js +97 -0
  26. package/dist/lib/model-tiers.d.ts +13 -7
  27. package/dist/lib/model-tiers.js +104 -35
  28. package/dist/lib/models.d.ts +16 -0
  29. package/dist/lib/models.js +17 -3
  30. package/dist/lib/secrets/Agents CLI.app/Contents/CodeResources +0 -0
  31. package/dist/lib/secrets/Agents CLI.app/Contents/MacOS/Agents CLI +0 -0
  32. package/dist/lib/secrets/bundles.d.ts +5 -30
  33. package/dist/lib/secrets/bundles.js +34 -60
  34. package/dist/lib/secrets/headless.d.ts +39 -0
  35. package/dist/lib/secrets/headless.js +63 -0
  36. package/dist/lib/secrets/index.d.ts +39 -0
  37. package/dist/lib/secrets/index.js +122 -6
  38. package/dist/lib/secrets/mcp.js +8 -4
  39. package/dist/lib/secrets/read-backoff.d.ts +27 -0
  40. package/dist/lib/secrets/read-backoff.js +64 -0
  41. package/dist/lib/secrets/session-store.js +6 -4
  42. package/dist/lib/secrets/vault.js +3 -1
  43. package/dist/lib/session/sync/config.d.ts +12 -11
  44. package/dist/lib/session/sync/config.js +40 -38
  45. package/dist/lib/share/config.js +4 -0
  46. package/dist/lib/types.d.ts +10 -0
  47. package/dist/lib/usage.js +3 -1
  48. package/dist/lib/versions.js +35 -0
  49. package/package.json +1 -1
@@ -1358,6 +1358,38 @@ function relocateGrokBinaryToVersionHome(installedVersion) {
1358
1358
  return;
1359
1359
  }
1360
1360
  }
1361
+ /**
1362
+ * Grok's version directory is keyed by release number alone, not by account —
1363
+ * so two DIFFERENT accounts that both self-update to the identical upstream
1364
+ * release ("latest") target the SAME on-disk `versions/grok/<version>/` home.
1365
+ * When that happens, the second account's `agents add grok@latest` writes
1366
+ * into an already-signed-in directory: grok's own auth flow treats
1367
+ * `~/.grok/auth.json` as authoritative for whichever process invoked it, so
1368
+ * the second account's credential record lands in a file that still names it
1369
+ * as the first account's install everywhere else in agents-cli's bookkeeping.
1370
+ *
1371
+ * Refuse before that happens: if the target version's home already has a
1372
+ * signed-in account whose identity differs from the account currently
1373
+ * driving this update (the previous global default), fail loud instead of
1374
+ * letting the second account silently displace the first's install.
1375
+ */
1376
+ async function checkGrokAccountCollision(installedVersion) {
1377
+ const targetHome = getVersionHomePath('grok', installedVersion);
1378
+ if (!fs.existsSync(targetHome))
1379
+ return; // fresh directory, nothing to collide with
1380
+ const sourceVersion = getGlobalDefault('grok');
1381
+ if (!sourceVersion || sourceVersion === installedVersion)
1382
+ return; // same install, not a collision
1383
+ const [targetEmail, sourceEmail] = await Promise.all([
1384
+ getAccountEmail('grok', targetHome),
1385
+ getAccountEmail('grok', getVersionHomePath('grok', sourceVersion)),
1386
+ ]);
1387
+ if (!targetEmail || !sourceEmail || targetEmail === sourceEmail)
1388
+ return;
1389
+ throw new Error(`grok@${installedVersion} is already installed for ${targetEmail}, but this update is running as ${sourceEmail}. ` +
1390
+ `Grok's self-updater can't distinguish two accounts that land on the same release — sign in to ${targetEmail}'s ` +
1391
+ `install (agents use grok@${installedVersion}) before updating it, or wait until the releases diverge.`);
1392
+ }
1361
1393
  /**
1362
1394
  * Install a specific version of an agent.
1363
1395
  */
@@ -1428,6 +1460,9 @@ export async function installVersion(agent, version, onProgress, opts) {
1428
1460
  // install into the real version so it stops shadowing `agents view`.
1429
1461
  await reconcileStaleLatestDir(agent, installedVersion);
1430
1462
  }
1463
+ if (agent === 'grok') {
1464
+ await checkGrokAccountCollision(installedVersion);
1465
+ }
1431
1466
  onProgress?.(`${agentConfig.name} installed. Setting up agents-cli version home for isolation...`);
1432
1467
  }
1433
1468
  catch (err) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@phnx-labs/agents-cli",
3
- "version": "1.22.3",
3
+ "version": "1.22.5",
4
4
  "description": "One CLI for all your AI coding agents - versions, config, cloud dispatch, sessions, and teams (now with first-class Grok Build CLI support)",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",