asdf
Squash the current repository state back into one baseline commit while preserving the README reframing and repository contents. Constraint: User explicitly requested a single squashed commit with subject "asdf" Confidence: high Scope-risk: broad Reversibility: clean Directive: This commit intentionally rewrites published history; coordinate before future force-pushes Tested: git status clean; local history rewritten to one commit; force-pushed main to origin and instructkr Not-tested: Fresh clone verification after push
This commit is contained in:
commit
d2542c9a62
50
src/commands/sandbox-toggle/index.ts
Normal file
50
src/commands/sandbox-toggle/index.ts
Normal file
@@ -0,0 +1,50 @@
|
||||
import figures from 'figures'
|
||||
import type { Command } from '../../commands.js'
|
||||
import { SandboxManager } from '../../utils/sandbox/sandbox-adapter.js'
|
||||
|
||||
const command = {
|
||||
name: 'sandbox',
|
||||
get description() {
|
||||
const currentlyEnabled = SandboxManager.isSandboxingEnabled()
|
||||
const autoAllow = SandboxManager.isAutoAllowBashIfSandboxedEnabled()
|
||||
const allowUnsandboxed = SandboxManager.areUnsandboxedCommandsAllowed()
|
||||
const isLocked = SandboxManager.areSandboxSettingsLockedByPolicy()
|
||||
const hasDeps = SandboxManager.checkDependencies().errors.length === 0
|
||||
|
||||
// Show warning icon if dependencies missing, otherwise enabled/disabled status
|
||||
let icon: string
|
||||
if (!hasDeps) {
|
||||
icon = figures.warning
|
||||
} else {
|
||||
icon = currentlyEnabled ? figures.tick : figures.circle
|
||||
}
|
||||
|
||||
let statusText = 'sandbox disabled'
|
||||
if (currentlyEnabled) {
|
||||
statusText = autoAllow
|
||||
? 'sandbox enabled (auto-allow)'
|
||||
: 'sandbox enabled'
|
||||
|
||||
// Add unsandboxed fallback status
|
||||
statusText += allowUnsandboxed ? ', fallback allowed' : ''
|
||||
}
|
||||
|
||||
if (isLocked) {
|
||||
statusText += ' (managed)'
|
||||
}
|
||||
|
||||
return `${icon} ${statusText} (⏎ to configure)`
|
||||
},
|
||||
argumentHint: 'exclude "command pattern"',
|
||||
get isHidden() {
|
||||
return (
|
||||
!SandboxManager.isSupportedPlatform() ||
|
||||
!SandboxManager.isPlatformInEnabledList()
|
||||
)
|
||||
},
|
||||
immediate: true,
|
||||
type: 'local-jsx',
|
||||
load: () => import('./sandbox-toggle.js'),
|
||||
} satisfies Command
|
||||
|
||||
export default command
|
||||
83
src/commands/sandbox-toggle/sandbox-toggle.tsx
Normal file
83
src/commands/sandbox-toggle/sandbox-toggle.tsx
Normal file
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user