π File detail
utils/extraUsage.ts
π§© .tsπ 24 linesπΎ 635 bytesπ text
β Back to All Filesπ― Use case
This file lives under βutils/β, which covers cross-cutting helpers (shell, tempfiles, settings, messages, process input, β¦). On the API surface it exposes isBilledAsExtraUsage β mainly functions, hooks, or classes. It composes internal code from auth and context (relative imports).
Generated from folder role, exports, dependency roots, and inline comments β not hand-reviewed for every path.
π§ Inline summary
import { isClaudeAISubscriber } from './auth.js' import { has1mContext } from './context.js' export function isBilledAsExtraUsage( model: string | null,
π€ Exports (heuristic)
isBilledAsExtraUsage
π₯οΈ Source preview
import { isClaudeAISubscriber } from './auth.js'
import { has1mContext } from './context.js'
export function isBilledAsExtraUsage(
model: string | null,
isFastMode: boolean,
isOpus1mMerged: boolean,
): boolean {
if (!isClaudeAISubscriber()) return false
if (isFastMode) return true
if (model === null || !has1mContext(model)) return false
const m = model
.toLowerCase()
.replace(/\[1m\]$/, '')
.trim()
const isOpus46 = m === 'opus' || m.includes('opus-4-6')
const isSonnet46 = m === 'sonnet' || m.includes('sonnet-4-6')
if (isOpus46 && isOpus1mMerged) return false
return isOpus46 || isSonnet46
}