MCPcopy Index your code
hub / github.com/codeaashu/claude-code / wrapWithSandbox

Function wrapWithSandbox

src/utils/sandbox/sandbox-adapter.ts:704–725  ·  view source on GitHub ↗

* Wrap command with sandbox, optionally specifying the shell to use

(
  command: string,
  binShell?: string,
  customConfig?: Partial<SandboxRuntimeConfig>,
  abortSignal?: AbortSignal,
)

Source from the content-addressed store, hash-verified

702 * Wrap command with sandbox, optionally specifying the shell to use
703 */
704async function wrapWithSandbox(
705 command: string,
706 binShell?: string,
707 customConfig?: Partial<SandboxRuntimeConfig>,
708 abortSignal?: AbortSignal,
709): Promise<string> {
710 // If sandboxing is enabled, ensure initialization is complete
711 if (isSandboxingEnabled()) {
712 if (initializationPromise) {
713 await initializationPromise
714 } else {
715 throw new Error('Sandbox failed to initialize. ')
716 }
717 }
718
719 return BaseSandboxManager.wrapWithSandbox(
720 command,
721 binShell,
722 customConfig,
723 abortSignal,
724 )
725}
726
727/**
728 * Initialize sandbox with log monitoring enabled by default

Callers

nothing calls this directly

Calls 2

isSandboxingEnabledFunction · 0.85
wrapWithSandboxMethod · 0.80

Tested by

no test coverage detected