tokenmaxxing 1.134.0 → 1.135.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/types.ts +2 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tokenmaxxing",
3
- "version": "1.134.0",
3
+ "version": "1.135.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/types.ts CHANGED
@@ -195,10 +195,10 @@ export const SessionCostSchema = z.object({ sessionId: z.string(), usd: z.number
195
195
  export type SessionCost = z.infer<typeof SessionCostSchema>;
196
196
 
197
197
  export const CostLineSchema = z
198
- .looseObject({ session_id: z.string(), total_cost_usd: z.number().optional(), cost: z.looseObject({ total_cost_usd: z.number() }).nullable().optional() })
198
+ .looseObject({ session_id: z.string(), num_turns: z.number().optional(), total_cost_usd: z.number().optional(), cost: z.looseObject({ total_cost_usd: z.number() }).nullable().optional() })
199
199
  .transform((line): SessionCost | null => {
200
200
  const usd = line.total_cost_usd ?? line.cost?.total_cost_usd;
201
- return usd == null ? null : { sessionId: line.session_id, usd };
201
+ return usd == null || (usd === 0 && line.num_turns === 0) ? null : { sessionId: line.session_id, usd };
202
202
  });
203
203
 
204
204
  export const EpochSecondsSchema = z.number().transform((seconds) => seconds * 1000);