tokenmaxxing 1.101.0 → 1.102.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/package.json +1 -1
  2. package/src/lib/codex.ts +5 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tokenmaxxing",
3
- "version": "1.101.0",
3
+ "version": "1.102.0",
4
4
  "description": "Automatic Claude Code account switching: pool multiple accounts, start each session on its own account, and resume a session on a fresher account when quota fills.",
5
5
  "type": "module",
6
6
  "license": "MIT",
package/src/lib/codex.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import { existsSync, readFileSync, rmSync } from "node:fs";
2
2
  import { join } from "node:path";
3
+ import { z } from "zod";
3
4
  import { writeFileAtomic } from "./atomic.ts";
4
5
  import { CODEX_BIN, MAX_WRAP_DEPTH, WRAP_DEPTH_ENV, resolveRealBin, verifyRealBin } from "./claudebin.ts";
5
6
  import { codexIdentityOf, codexStoreUsable, deleteCodexStoreAuth, ensureCodexStoreHome, isCodexAccessExpiring, readCodexAuthAt, readCodexStoreAuth, writeCodexStoreAuth } from "./codexauth.ts";
@@ -189,11 +190,13 @@ async function importLive(): Promise<Harvest | null> {
189
190
  return login();
190
191
  }
191
192
 
193
+ const CodexStoreModeSchema = z.looseObject({ cli_auth_credentials_store: z.string().optional() });
194
+
192
195
  function storePinnedAwayFromFile(): boolean {
193
196
  const configToml = `${codexPaths.home}/config.toml`;
194
197
  if (!existsSync(configToml)) return false;
195
- const config = Bun.TOML.parse(readFileSync(configToml, "utf8"));
196
- return "cli_auth_credentials_store" in config && config.cli_auth_credentials_store !== "file";
198
+ const store = CodexStoreModeSchema.parse(Bun.TOML.parse(readFileSync(configToml, "utf8"))).cli_auth_credentials_store;
199
+ return store !== undefined && store !== "file";
197
200
  }
198
201
 
199
202
  function preflight(): void {