π File detail
utils/shell/shellProvider.ts
π§© .tsπ 34 linesπΎ 955 bytesπ text
β Back to All Filesπ― Use case
This file lives under βutils/β, which covers cross-cutting helpers (shell, tempfiles, settings, messages, process input, β¦). On the API surface it exposes SHELL_TYPES, ShellType, DEFAULT_HOOK_SHELL, and ShellProvider β mainly types, interfaces, or factory objects.
Generated from folder role, exports, dependency roots, and inline comments β not hand-reviewed for every path.
π§ Inline summary
export const SHELL_TYPES = ['bash', 'powershell'] as const export type ShellType = (typeof SHELL_TYPES)[number] export const DEFAULT_HOOK_SHELL: ShellType = 'bash' export type ShellProvider = {
π€ Exports (heuristic)
SHELL_TYPESShellTypeDEFAULT_HOOK_SHELLShellProvider
π₯οΈ Source preview
export const SHELL_TYPES = ['bash', 'powershell'] as const
export type ShellType = (typeof SHELL_TYPES)[number]
export const DEFAULT_HOOK_SHELL: ShellType = 'bash'
export type ShellProvider = {
type: ShellType
shellPath: string
detached: boolean
/**
* Build the full command string including all shell-specific setup.
* For bash: source snapshot, session env, disable extglob, eval-wrap, pwd tracking.
*/
buildExecCommand(
command: string,
opts: {
id: number | string
sandboxTmpDir?: string
useSandbox: boolean
},
): Promise<{ commandString: string; cwdFilePath: string }>
/**
* Shell args for spawn (e.g., ['-c', '-l', cmd] for bash).
*/
getSpawnArgs(commandString: string): string[]
/**
* Extra env vars for this shell type.
* May perform async initialization (e.g., tmux socket setup for bash).
*/
getEnvironmentOverrides(command: string): Promise<Record<string, string>>
}