source dump of claude code
at main 31 lines 1.1 kB view raw
1import { getIsNonInteractiveSession } from '../../bootstrap/state.js' 2import type { Command } from '../../commands.js' 3import { isOverageProvisioningAllowed } from '../../utils/auth.js' 4import { isEnvTruthy } from '../../utils/envUtils.js' 5 6function isExtraUsageAllowed(): boolean { 7 if (isEnvTruthy(process.env.DISABLE_EXTRA_USAGE_COMMAND)) { 8 return false 9 } 10 return isOverageProvisioningAllowed() 11} 12 13export const extraUsage = { 14 type: 'local-jsx', 15 name: 'extra-usage', 16 description: 'Configure extra usage to keep working when limits are hit', 17 isEnabled: () => isExtraUsageAllowed() && !getIsNonInteractiveSession(), 18 load: () => import('./extra-usage.js'), 19} satisfies Command 20 21export const extraUsageNonInteractive = { 22 type: 'local', 23 name: 'extra-usage', 24 supportsNonInteractive: true, 25 description: 'Configure extra usage to keep working when limits are hit', 26 isEnabled: () => isExtraUsageAllowed() && getIsNonInteractiveSession(), 27 get isHidden() { 28 return !getIsNonInteractiveSession() 29 }, 30 load: () => import('./extra-usage-noninteractive.js'), 31} satisfies Command