teamclaude-cloud 1.5.6 → 1.5.7

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "teamclaude-cloud",
3
- "version": "1.5.6",
3
+ "version": "1.5.7",
4
4
  "description": "Multi-account Claude proxy with quota-based rotation + cloud token sync and auth-key control",
5
5
  "type": "module",
6
6
  "main": "src/index.js",
package/src/index.js CHANGED
@@ -9,7 +9,7 @@ import { createProxyServer } from './server.js';
9
9
  import { importCredentials, loginOAuth, fetchProfile, refreshAccessToken, isTokenExpiringSoon } from './oauth.js';
10
10
  import { cloudLogin, cloudValidateOwner, cloudRefreshSession, cloudPush, cloudPushUsage, cloudReportUsage, cloudPull, cloudRefreshToken, cloudReportToken, cloudKeyCreate, cloudKeyList, cloudKeyRevoke, cloudKeyMove, cloudGroupList, cloudGroupCreate, cloudGroupRename, cloudGroupDelete, cloudGroupSetAccounts, cloudAccountSetEnabled, buildUsageFromQuota, mergePulledAccounts, resolveCloud, DEFAULT_CLOUD, keySource, reconcileRemovedAccounts } from './cloud.js';
11
11
  import { TUI } from './tui.js';
12
- import { maskIf, maskEmail } from './mask.js';
12
+ import { maskIf, maskEmail, maskEmailsIn } from './mask.js';
13
13
 
14
14
  const args = process.argv.slice(2);
15
15
  const command = args[0];
@@ -989,7 +989,7 @@ async function accountsCommand() {
989
989
  const src = a.source ? `, ${a.source}` : '';
990
990
  console.log(` [${i + 1}] ${maskIf(a.name, config.maskMode)} (${status}${src})`);
991
991
  if (hasProfile && p.email && p.email !== a.name) console.log(` Email: ${maskIf(p.email, config.maskMode)}`);
992
- if (hasProfile && p.orgName) console.log(` Org: ${p.orgName}`);
992
+ if (hasProfile && p.orgName) console.log(` Org: ${maskEmailsIn(p.orgName, config.maskMode)}`);
993
993
  if (verbose && a.expiresAt) {
994
994
  const remaining = a.expiresAt - Date.now();
995
995
  if (remaining <= 0) {
package/src/mask.js CHANGED
@@ -29,3 +29,12 @@ export function maskEmail(value) {
29
29
  export function maskIf(value, on) {
30
30
  return on ? maskEmail(value) : value;
31
31
  }
32
+
33
+ // Mask every email SUBSTRING inside a free-form string (log lines, "X's Organization",
34
+ // generic table cells) — non-email text is left intact. Use this where an email is
35
+ // embedded in a larger string, not the whole value.
36
+ const EMAIL_RE = /[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}/g;
37
+ export function maskEmailsIn(value, on) {
38
+ if (!on || typeof value !== 'string') return value;
39
+ return value.replace(EMAIL_RE, (m) => maskEmail(m));
40
+ }
package/src/tui.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { importCredentials, fetchProfile } from './oauth.js';
2
- import { maskIf } from './mask.js';
2
+ import { maskIf, maskEmailsIn } from './mask.js';
3
3
 
4
4
  // ── ANSI helpers ─────────────────────────────────────────────
5
5
 
@@ -214,8 +214,7 @@ export class TUI {
214
214
  // (Codex HIGH ×3). Covers TUI-generated lines AND redirected server/account-manager
215
215
  // console output, so ordinary request/activity logging can't bypass mask mode.
216
216
  _maskLog(s) {
217
- if (this.config?.maskMode !== true || typeof s !== 'string') return s;
218
- return s.replace(/[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}/g, (m) => maskIf(m, true));
217
+ return maskEmailsIn(s, this.config?.maskMode === true);
219
218
  }
220
219
 
221
220
  // Mask a single account name for direct render (active-requests line, etc.).