()
| 5 | const command = { |
| 6 | name: 'sandbox', |
| 7 | get description() { |
| 8 | const currentlyEnabled = SandboxManager.isSandboxingEnabled() |
| 9 | const autoAllow = SandboxManager.isAutoAllowBashIfSandboxedEnabled() |
| 10 | const allowUnsandboxed = SandboxManager.areUnsandboxedCommandsAllowed() |
| 11 | const isLocked = SandboxManager.areSandboxSettingsLockedByPolicy() |
| 12 | const hasDeps = SandboxManager.checkDependencies().errors.length === 0 |
| 13 | |
| 14 | // Show warning icon if dependencies missing, otherwise enabled/disabled status |
| 15 | let icon: string |
| 16 | if (!hasDeps) { |
| 17 | icon = figures.warning |
| 18 | } else { |
| 19 | icon = currentlyEnabled ? figures.tick : figures.circle |
| 20 | } |
| 21 | |
| 22 | let statusText = 'sandbox disabled' |
| 23 | if (currentlyEnabled) { |
| 24 | statusText = autoAllow |
| 25 | ? 'sandbox enabled (auto-allow)' |
| 26 | : 'sandbox enabled' |
| 27 | |
| 28 | // Add unsandboxed fallback status |
| 29 | statusText += allowUnsandboxed ? ', fallback allowed' : '' |
| 30 | } |
| 31 | |
| 32 | if (isLocked) { |
| 33 | statusText += ' (managed)' |
| 34 | } |
| 35 | |
| 36 | return `${icon} ${statusText} (⏎ to configure)` |
| 37 | }, |
| 38 | argumentHint: 'exclude "command pattern"', |
| 39 | get isHidden() { |
| 40 | return ( |
nothing calls this directly
no test coverage detected