(params: {
session: CommandAvailabilitySession
totalCost: string
isUsingOverage: boolean
isInternalBuild: boolean
})
| 9 | } from '../../utils/commandAvailability.js' |
| 10 | |
| 11 | export function buildCostCommandText(params: { |
| 12 | session: CommandAvailabilitySession |
| 13 | totalCost: string |
| 14 | isUsingOverage: boolean |
| 15 | isInternalBuild: boolean |
| 16 | }): string { |
| 17 | const { session, totalCost, isUsingOverage, isInternalBuild } = params |
| 18 | |
| 19 | if (!hasOauthCommandAvailabilitySession(session)) { |
| 20 | return totalCost |
| 21 | } |
| 22 | |
| 23 | let value: string |
| 24 | |
| 25 | if (isUsingOverage) { |
| 26 | value = |
| 27 | 'You are currently using your overages to power your Code usage. We will automatically switch you back to your subscription rate limits when they reset' |
| 28 | } else { |
| 29 | value = |
| 30 | 'You are currently using your subscription to power your Code usage' |
| 31 | } |
| 32 | |
| 33 | if (isInternalBuild) { |
| 34 | value += `\n\n[NOUMENA-ONLY] Showing cost anyway:\n ${totalCost}` |
| 35 | } |
| 36 | |
| 37 | return value |
| 38 | } |
| 39 | |
| 40 | export const call: LocalCommandCall = async () => { |
| 41 | const totalCost = formatTotalCost() |
no test coverage detected