@4pm/cli 1.22.0 → 1.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.
Files changed (2) hide show
  1. package/dist/index.js +19 -4
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -39291,13 +39291,25 @@ function claudeHomeDirs(config) {
39291
39291
  return dirs.length > 0 ? dirs : [join9(homedir3(), ".claude")];
39292
39292
  }
39293
39293
  function profileDisplayLabel(dir2) {
39294
+ return profileAccountEmail(dir2) ?? basename(dir2);
39295
+ }
39296
+ function profileAccountEmail(dir2) {
39294
39297
  try {
39295
39298
  const raw = JSON.parse(readFileSync8(join9(dir2, ".claude.json"), "utf8"));
39296
- const email = raw.oauthAccount?.emailAddress;
39297
- if (email && email.trim()) return email;
39299
+ const email = raw.oauthAccount?.emailAddress?.trim();
39300
+ return email ? email : null;
39298
39301
  } catch {
39302
+ return null;
39299
39303
  }
39300
- return basename(dir2);
39304
+ }
39305
+ function aiAccountLabels(config) {
39306
+ const labels = isUnifiedConfig(config) ? config.aiProfiles.filter(isUsableCredential).map((c) => {
39307
+ const dir2 = resolveHomePath(c.profile);
39308
+ return profileAccountEmail(dir2) ?? (c.label?.trim() || basename(dir2));
39309
+ }) : [...profileDirs(config.claudeHome), ...profileDirs(config.codexHome), ...profileDirs(config.antigravityHome)].map(
39310
+ (dir2) => profileDisplayLabel(dir2)
39311
+ );
39312
+ return [...new Set(labels)];
39301
39313
  }
39302
39314
  function profileEnvVar(cmd) {
39303
39315
  if (cmd.includes("claude")) return "CLAUDE_CONFIG_DIR";
@@ -45100,7 +45112,10 @@ var WsClient = class {
45100
45112
  // The machine-user AI-run limit (0 = unlimited) + profile count so a dispatch can resolve the
45101
45113
  // effective timeout and derive the SSE reply windows server-side (ADR-0256).
45102
45114
  aiRunTimeoutSec: config.aiRunTimeoutSec ?? 0,
45103
- aiProfileCount
45115
+ aiProfileCount,
45116
+ // The configured AI accounts (emails when readable) — admin-only visibility of which AI
45117
+ // account a (rented) machine runs on + the shared-account check (ADR-0354).
45118
+ aiAccounts: aiAccountLabels(config)
45104
45119
  });
45105
45120
  }
45106
45121
  /** Heartbeat every 30s: ping + periodically re-report machine.status. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@4pm/cli",
3
- "version": "1.22.0",
3
+ "version": "1.23.0",
4
4
  "private": false,
5
5
  "description": "4PM CLI — drives Claude/Codex CLIs on AI worker machines (Node + TypeScript)",
6
6
  "license": "LicenseRef-4PM-Source-Available",