tokenmaxxing 1.48.0 → 1.49.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tokenmaxxing",
3
- "version": "1.48.0",
3
+ "version": "1.49.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",
@@ -4,6 +4,7 @@ import { evaluateAndMaybeSwap } from "../lib/decide.ts";
4
4
  import { supervisedSession, writeRespawnMarker } from "../lib/sessions.ts";
5
5
  import { loadConfig } from "../lib/state.ts";
6
6
  import { classifyEnforcedLimit, findEnforcedRow, parseErrorBody, readTranscriptTail } from "../lib/usage.ts";
7
+ import { paths } from "../lib/paths.ts";
7
8
  import { JsonTextSchema, type EnforcedLimit } from "../lib/types.ts";
8
9
  import { log } from "../lib/log.ts";
9
10
  import { readStdin } from "./statusline.ts";
@@ -52,6 +53,16 @@ export async function runStopFailureHook(): Promise<number> {
52
53
  });
53
54
  }
54
55
 
56
+ if (session == null && limit != null) {
57
+ const shim = `${paths.binDir}/claude`;
58
+ log("stopfailure.unsupervised_hint", { sid: stdinSid });
59
+ process.stdout.write(
60
+ `${JSON.stringify({
61
+ systemMessage: `tokenmaxxing: this session runs outside the supervisor, so it cannot move to another account at the limit. Move it yourself: ${stdinSid ? `${shim} --resume ${stdinSid}` : `resume it through ${shim}`}`,
62
+ })}\n`,
63
+ );
64
+ }
65
+
55
66
  const decision = await evaluateAndMaybeSwap(claude, now, canRespawn && enforced != null, enforced);
56
67
  if (enforced && session && canRespawn && decision.account && (decision.swapped || decision.waitUntil !== undefined)) {
57
68
  writeRespawnMarker({ session, sessionId: stdinSid ?? session.sid, accountId: decision.account.id, waitUntil: decision.waitUntil ?? now, compact: false });