forked from ultraworkers/claw-code
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.ts
More file actions
31 lines (28 loc) · 1.08 KB
/
Copy pathindex.ts
File metadata and controls
31 lines (28 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import { getIsNonInteractiveSession } from '../../bootstrap/state.js'
import type { Command } from '../../commands.js'
import { isOverageProvisioningAllowed } from '../../utils/auth.js'
import { isEnvTruthy } from '../../utils/envUtils.js'
function isExtraUsageAllowed(): boolean {
if (isEnvTruthy(process.env.DISABLE_EXTRA_USAGE_COMMAND)) {
return false
}
return isOverageProvisioningAllowed()
}
export const extraUsage = {
type: 'local-jsx',
name: 'extra-usage',
description: 'Configure extra usage to keep working when limits are hit',
isEnabled: () => isExtraUsageAllowed() && !getIsNonInteractiveSession(),
load: () => import('./extra-usage.js'),
} satisfies Command
export const extraUsageNonInteractive = {
type: 'local',
name: 'extra-usage',
supportsNonInteractive: true,
description: 'Configure extra usage to keep working when limits are hit',
isEnabled: () => isExtraUsageAllowed() && getIsNonInteractiveSession(),
get isHidden() {
return !getIsNonInteractiveSession()
},
load: () => import('./extra-usage-noninteractive.js'),
} satisfies Command